Drop new connection instead of old one when duplicate MNAUTH is received (#3272)
This commit is contained in:
parent
817cd9a177
commit
ebf529e8aa
@ -101,12 +101,16 @@ void CMNAuth::ProcessMessage(CNode* pnode, const std::string& strCommand, CDataS
|
||||
|
||||
connman.ForEachNode([&](CNode* pnode2) {
|
||||
if (pnode2->verifiedProRegTxHash == mnauth.proRegTxHash) {
|
||||
LogPrint(BCLog::NET, "CMNAuth::ProcessMessage -- Masternode %s has already verified as peer %d, dropping old connection. peer=%d\n",
|
||||
LogPrint(BCLog::NET, "CMNAuth::ProcessMessage -- Masternode %s has already verified as peer %d, dropping new connection. peer=%d\n",
|
||||
mnauth.proRegTxHash.ToString(), pnode2->GetId(), pnode->GetId());
|
||||
pnode2->fDisconnect = true;
|
||||
pnode->fDisconnect = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (pnode->fDisconnect) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(pnode->cs_mnauth);
|
||||
pnode->verifiedProRegTxHash = mnauth.proRegTxHash;
|
||||
|
Loading…
Reference in New Issue
Block a user