From 397a157e8d7157778a0240af3e491729b566f94d Mon Sep 17 00:00:00 2001 From: pasta Date: Wed, 20 Nov 2024 13:54:33 -0600 Subject: [PATCH] refactor: introduce cs_pendingSigns --- src/llmq/signing_shares.cpp | 4 ++-- src/llmq/signing_shares.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/llmq/signing_shares.cpp b/src/llmq/signing_shares.cpp index baa31593d2546..5f53acce396c6 100644 --- a/src/llmq/signing_shares.cpp +++ b/src/llmq/signing_shares.cpp @@ -1479,7 +1479,7 @@ 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); } @@ -1487,7 +1487,7 @@ void CSigSharesManager::SignPendingSigShares() { std::vector v; { - LOCK(cs); + LOCK(cs_pendingSigns); v = std::move(pendingSigns); } diff --git a/src/llmq/signing_shares.h b/src/llmq/signing_shares.h index e21b6e18ab101..cd772b85a0b65 100644 --- a/src/llmq/signing_shares.h +++ b/src/llmq/signing_shares.h @@ -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 pendingSigns GUARDED_BY(cs); + Mutex cs_pendingSigns; + std::vector pendingSigns GUARDED_BY(cs_pendingSigns); FastRandomContext rnd GUARDED_BY(cs);