[Node] Only allow 1 node with the same public key
This commit is contained in:
parent
f68baa8303
commit
e34958d478
@ -484,6 +484,15 @@ namespace Components
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& node : Node::Nodes)
|
||||
{
|
||||
if (node.publicKey == entry->publicKey)
|
||||
{
|
||||
entry->lastTime = Game::Sys_Milliseconds();
|
||||
entry->state = Node::STATE_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
// Mark as registered
|
||||
entry->lastTime = Game::Sys_Milliseconds();
|
||||
entry->state = Node::STATE_VALID;
|
||||
|
@ -227,6 +227,11 @@ namespace Utils
|
||||
ZeroMemory(this->getKeyPtr(), sizeof(*this->getKeyPtr()));
|
||||
}
|
||||
|
||||
bool operator==(Key& key)
|
||||
{
|
||||
return (this->isValid() && key.isValid() && this->serialize(PK_PUBLIC) == key.serialize(PK_PUBLIC));
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<ecc_key> keyStorage;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user