Skip to content

Commit

Permalink
RPC/Blockchain: Move {cs,g}_relevant_blocks into scanblocks scope
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Nov 15, 2024
1 parent 5698131 commit 851d354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2320,9 +2320,6 @@ static RPCHelpMan scantxoutset()
};
}

static GlobalMutex cs_relevant_blocks;
static UniValue g_relevant_blocks GUARDED_BY(cs_relevant_blocks);

/** RAII object to prevent concurrency issue when scanning blockfilters */
static std::atomic<int> g_scanfilter_progress;
static std::atomic<int> g_scanfilter_progress_height;
Expand Down Expand Up @@ -2431,6 +2428,9 @@ static RPCHelpMan scanblocks()
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
static GlobalMutex cs_relevant_blocks;
static UniValue g_relevant_blocks GUARDED_BY(cs_relevant_blocks);

UniValue ret(UniValue::VOBJ);
if (request.params[0].get_str() == "status") {
BlockFiltersScanReserver reserver;
Expand Down

0 comments on commit 851d354

Please sign in to comment.