Skip to content

Commit dfe99c9

Browse files
UdjinM6codablock
authored andcommitted
Decouple cs_mnauth/cs_main (#3220)
1 parent 08f447a commit dfe99c9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/evo/mnauth.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ void CMNAuth::ProcessMessage(CNode* pnode, const std::string& strCommand, CDataS
5555
CMNAuth mnauth;
5656
vRecv >> mnauth;
5757

58+
// only one MNAUTH allowed
59+
bool fAlreadyHaveMNAUTH = false;
5860
{
5961
LOCK(pnode->cs_mnauth);
60-
// only one MNAUTH allowed
61-
if (!pnode->verifiedProRegTxHash.IsNull()) {
62-
LOCK(cs_main);
63-
Misbehaving(pnode->GetId(), 100);
64-
return;
65-
}
62+
fAlreadyHaveMNAUTH = !pnode->verifiedProRegTxHash.IsNull();
63+
}
64+
if (fAlreadyHaveMNAUTH) {
65+
LOCK(cs_main);
66+
Misbehaving(pnode->GetId(), 100);
67+
return;
6668
}
6769

6870
if (mnauth.proRegTxHash.IsNull() || !mnauth.sig.IsValid()) {

0 commit comments

Comments
 (0)