Skip to content

Commit

Permalink
rpc/blockchain: a constant craving
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtowns committed Jan 28, 2022
1 parent 5179656 commit fbab43f
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 @@ -1669,16 +1669,16 @@ static RPCHelpMan getdeploymentinfo()
RPCExamples{ HelpExampleCli("getdeploymentinfo", "") + HelpExampleRpc("getdeploymentinfo", "") },
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
ChainstateManager& chainman = EnsureAnyChainman(request.context);
const ChainstateManager& chainman = EnsureAnyChainman(request.context);
LOCK(cs_main);
CChainState& active_chainstate = chainman.ActiveChainstate();
const CChainState& active_chainstate = chainman.ActiveChainstate();

const CBlockIndex* tip;
if (request.params[0].isNull()) {
tip = active_chainstate.m_chain.Tip();
CHECK_NONFATAL(tip);
} else {
uint256 hash(ParseHashV(request.params[0], "blockhash"));
const uint256 hash(ParseHashV(request.params[0], "blockhash"));
tip = chainman.m_blockman.LookupBlockIndex(hash);
if (!tip) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
Expand Down

0 comments on commit fbab43f

Please sign in to comment.