diff options
author | Carl Dong <contact@carldong.me> | 2021-04-12 18:48:59 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-04-14 11:13:09 -0400 |
commit | f99913969f92b8b9cef1b83f5ee8e6a9267b4af0 (patch) | |
tree | a7a155e2987f15575e832981f8f5f4dfd2219725 /src | |
parent | 6a3d1920209cded0dae52fb9070a3530d9a4e5fd (diff) |
rpc: Remove unnecessary casting of block height
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/blockchain.cpp | 2 | ||||
-rw-r--r-- | src/rpc/mining.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 5fd1521e73..53e8c6d5af 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1369,7 +1369,7 @@ RPCHelpMan getblockchaininfo() const int height = tip->nHeight; UniValue obj(UniValue::VOBJ); obj.pushKV("chain", Params().NetworkIDString()); - obj.pushKV("blocks", (int)height); + obj.pushKV("blocks", height); obj.pushKV("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1); obj.pushKV("bestblockhash", tip->GetBlockHash().GetHex()); obj.pushKV("difficulty", (double)GetDifficulty(tip)); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 37c87d7b01..15e03194a3 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -434,7 +434,7 @@ static RPCHelpMan getmininginfo() const CChain& active_chain = chainman.ActiveChain(); UniValue obj(UniValue::VOBJ); - obj.pushKV("blocks", (int)active_chain.Height()); + obj.pushKV("blocks", active_chain.Height()); if (BlockAssembler::m_last_block_weight) obj.pushKV("currentblockweight", *BlockAssembler::m_last_block_weight); if (BlockAssembler::m_last_block_num_txs) obj.pushKV("currentblocktx", *BlockAssembler::m_last_block_num_txs); obj.pushKV("difficulty", (double)GetDifficulty(active_chain.Tip())); |