mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
fix: potential bug due to unspecified state of std::vector after move
This commit is contained in:
parent
8a05f0caaa
commit
83e0bb6e35
@ -520,10 +520,8 @@ void CSigningManager::CollectPendingRecoveredSigsToVerify(
|
||||
void CSigningManager::ProcessPendingReconstructedRecoveredSigs()
|
||||
{
|
||||
decltype(pendingReconstructedRecoveredSigs) m;
|
||||
{
|
||||
LOCK(cs_pending);
|
||||
m = std::move(pendingReconstructedRecoveredSigs);
|
||||
}
|
||||
WITH_LOCK(cs_pending, swap(m, pendingReconstructedRecoveredSigs));
|
||||
|
||||
for (const auto& p : m) {
|
||||
ProcessRecoveredSig(p.second);
|
||||
}
|
||||
|
@ -1490,10 +1490,7 @@ void CSigSharesManager::AsyncSign(const CQuorumCPtr& quorum, const uint256& id,
|
||||
void CSigSharesManager::SignPendingSigShares()
|
||||
{
|
||||
std::vector<PendingSignatureData> v;
|
||||
{
|
||||
LOCK(cs_pendingSigns);
|
||||
v = std::move(pendingSigns);
|
||||
}
|
||||
WITH_LOCK(cs_pendingSigns, v.swap(pendingSigns));
|
||||
|
||||
for (const auto& [pQuorum, id, msgHash] : v) {
|
||||
auto opt_sigShare = CreateSigShare(pQuorum, id, msgHash);
|
||||
|
Loading…
Reference in New Issue
Block a user