Skip to content

Commit

Permalink
Use snapshot in getblockcount
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar committed Nov 26, 2023
1 parent 3913a4f commit 40f4348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ static UniValue getblockcount(const JSONRPCRequest& request)
},
}.Check(request);

LOCK(cs_main);
return ::ChainActive().Height();
const auto view = ::GetViewSnapshot();
return view->GetLastHeight();
}

static UniValue getbestblockhash(const JSONRPCRequest& request)
Expand Down

0 comments on commit 40f4348

Please sign in to comment.