Skip to content

Commit ebf529e

Browse files
codablockUdjinM6
authored andcommitted
Drop new connection instead of old one when duplicate MNAUTH is received (#3272)
1 parent 817cd9a commit ebf529e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/evo/mnauth.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ void CMNAuth::ProcessMessage(CNode* pnode, const std::string& strCommand, CDataS
101101

102102
connman.ForEachNode([&](CNode* pnode2) {
103103
if (pnode2->verifiedProRegTxHash == mnauth.proRegTxHash) {
104-
LogPrint(BCLog::NET, "CMNAuth::ProcessMessage -- Masternode %s has already verified as peer %d, dropping old connection. peer=%d\n",
104+
LogPrint(BCLog::NET, "CMNAuth::ProcessMessage -- Masternode %s has already verified as peer %d, dropping new connection. peer=%d\n",
105105
mnauth.proRegTxHash.ToString(), pnode2->GetId(), pnode->GetId());
106-
pnode2->fDisconnect = true;
106+
pnode->fDisconnect = true;
107107
}
108108
});
109109

110+
if (pnode->fDisconnect) {
111+
return;
112+
}
113+
110114
{
111115
LOCK(pnode->cs_mnauth);
112116
pnode->verifiedProRegTxHash = mnauth.proRegTxHash;

0 commit comments

Comments
 (0)