Decouple cs_mnauth/cs_main (#3220)

This commit is contained in:
UdjinM6 2019-12-05 21:28:53 +03:00 committed by Alexander Block
parent 08f447af92
commit dfe99c9507

View File

@ -55,14 +55,16 @@ void CMNAuth::ProcessMessage(CNode* pnode, const std::string& strCommand, CDataS
CMNAuth mnauth;
vRecv >> mnauth;
// only one MNAUTH allowed
bool fAlreadyHaveMNAUTH = false;
{
LOCK(pnode->cs_mnauth);
// only one MNAUTH allowed
if (!pnode->verifiedProRegTxHash.IsNull()) {
LOCK(cs_main);
Misbehaving(pnode->GetId(), 100);
return;
}
fAlreadyHaveMNAUTH = !pnode->verifiedProRegTxHash.IsNull();
}
if (fAlreadyHaveMNAUTH) {
LOCK(cs_main);
Misbehaving(pnode->GetId(), 100);
return;
}
if (mnauth.proRegTxHash.IsNull() || !mnauth.sig.IsValid()) {