mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
Avoid accessing pendingContributionVerifications from VerifyPendingContributions while ReceiveMessage is still doing its job (#3782)
This commit is contained in:
parent
0814e6145d
commit
d8f8f174c0
@ -260,6 +260,8 @@ bool CDKGSession::PreVerifyMessage(const uint256& hash, const CDKGContribution&
|
||||
|
||||
void CDKGSession::ReceiveMessage(const uint256& hash, const CDKGContribution& qc, bool& retBan)
|
||||
{
|
||||
LOCK(cs_pending);
|
||||
|
||||
CDKGLogger logger(*this, __func__);
|
||||
|
||||
retBan = false;
|
||||
@ -359,6 +361,8 @@ void CDKGSession::ReceiveMessage(const uint256& hash, const CDKGContribution& qc
|
||||
// See CBLSWorker::VerifyContributionShares for more details.
|
||||
void CDKGSession::VerifyPendingContributions()
|
||||
{
|
||||
AssertLockHeld(cs_pending);
|
||||
|
||||
CDKGLogger logger(*this, __func__);
|
||||
|
||||
cxxtimer::Timer t1(true);
|
||||
@ -412,7 +416,10 @@ void CDKGSession::VerifyAndComplain(CDKGPendingMessages& pendingMessages)
|
||||
return;
|
||||
}
|
||||
|
||||
VerifyPendingContributions();
|
||||
{
|
||||
LOCK(cs_pending);
|
||||
VerifyPendingContributions();
|
||||
}
|
||||
|
||||
CDKGLogger logger(*this, __func__);
|
||||
|
||||
|
@ -277,6 +277,7 @@ private:
|
||||
std::map<uint256, CDKGJustification> justifications;
|
||||
std::map<uint256, CDKGPrematureCommitment> prematureCommitments;
|
||||
|
||||
mutable CCriticalSection cs_pending;
|
||||
std::vector<size_t> pendingContributionVerifications;
|
||||
|
||||
// filled by ReceivePrematureCommitment and used by FinalizeCommitments
|
||||
|
Loading…
Reference in New Issue
Block a user