From 982fc9a069988b06ab9829a6f0bbd7e61dd6054e Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sun, 6 Oct 2024 22:49:50 +0700 Subject: [PATCH] fix: avoid lock annotation for govman.cs in voteraw --- src/rpc/governance.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/governance.cpp b/src/rpc/governance.cpp index 45a7ea26c4..a4bab7ea84 100644 --- a/src/rpc/governance.cpp +++ b/src/rpc/governance.cpp @@ -955,14 +955,14 @@ static RPCHelpMan voteraw() const NodeContext& node = EnsureAnyNodeContext(request.context); CHECK_NONFATAL(node.govman); - GovernanceObject govObjType = WITH_LOCK(node.govman->cs, return [&](){ - AssertLockHeld(node.govman->cs); + GovernanceObject govObjType = [&]() { + LOCK(node.govman->cs); const CGovernanceObject *pGovObj = node.govman->FindConstGovernanceObject(hashGovObj); if (!pGovObj) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Governance object not found"); } return pGovObj->GetObjectType(); - }()); + }(); int64_t nTime = request.params[5].get_int64();