Skip to content

Commit

Permalink
refactor: introduce cs_pendingSigns
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Nov 20, 2024
1 parent 5adf92c commit 397a157
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/llmq/signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,15 +1479,15 @@ void CSigSharesManager::WorkThreadMain()

void CSigSharesManager::AsyncSign(const CQuorumCPtr& quorum, const uint256& id, const uint256& msgHash)
{
LOCK(cs);
LOCK(cs_pendingSigns);
pendingSigns.emplace_back(quorum, id, msgHash);
}

void CSigSharesManager::SignPendingSigShares()
{
std::vector<PendingSignatureData> v;
{
LOCK(cs);
LOCK(cs_pendingSigns);
v = std::move(pendingSigns);
}

Expand Down
3 changes: 2 additions & 1 deletion src/llmq/signing_shares.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ class CSigSharesManager : public CRecoveredSigsListener
PendingSignatureData(CQuorumCPtr quorum, const uint256& id, const uint256& msgHash) : quorum(std::move(quorum)), id(id), msgHash(msgHash){}
};

std::vector<PendingSignatureData> pendingSigns GUARDED_BY(cs);
Mutex cs_pendingSigns;
std::vector<PendingSignatureData> pendingSigns GUARDED_BY(cs_pendingSigns);

FastRandomContext rnd GUARDED_BY(cs);

Expand Down

0 comments on commit 397a157

Please sign in to comment.