Skip to content

Commit

Permalink
rpc: Use Ensure(Any)Chainman in assumeutxo related RPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
fjahr committed Oct 6, 2023
1 parent 710e5db commit 5d227a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ static RPCHelpMan loadtxoutset()
LogPrintf("[snapshot] waiting to see blockheader %s in headers chain before snapshot activation\n",
base_blockhash.ToString());

ChainstateManager& chainman = *node.chainman;
ChainstateManager& chainman = EnsureChainman(node);

while (max_secs_to_wait_for_headers > 0) {
snapshot_start_block = WITH_LOCK(::cs_main,
Expand Down Expand Up @@ -2831,8 +2831,7 @@ return RPCHelpMan{
LOCK(cs_main);
UniValue obj(UniValue::VOBJ);

NodeContext& node = EnsureAnyNodeContext(request.context);
ChainstateManager& chainman = *node.chainman;
ChainstateManager& chainman = EnsureAnyChainman(request.context);

auto make_chain_data = [&](const Chainstate& cs, bool validated) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
AssertLockHeld(::cs_main);
Expand Down

0 comments on commit 5d227a6

Please sign in to comment.