From fa2bbc9e4cfe017436a5167ab5c443f4412efa3c Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 28 Oct 2025 15:20:38 +0100 Subject: [PATCH] refactor: [rpc] Remove cast when reporting serialized size The values are small enough to fit in an int, so the cast is at best redundant. However, UniValue can handle any integer type, so having to think about the cast here is also confusing. --- src/rpc/blockchain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 2ff5f52977a..831bf5fe498 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -185,9 +185,9 @@ UniValue blockToJSON(BlockManager& blockman, const CBlock& block, const CBlockIn { UniValue result = blockheaderToJSON(tip, blockindex, pow_limit); - result.pushKV("strippedsize", (int)::GetSerializeSize(TX_NO_WITNESS(block))); - result.pushKV("size", (int)::GetSerializeSize(TX_WITH_WITNESS(block))); - result.pushKV("weight", (int)::GetBlockWeight(block)); + result.pushKV("strippedsize", ::GetSerializeSize(TX_NO_WITNESS(block))); + result.pushKV("size", ::GetSerializeSize(TX_WITH_WITNESS(block))); + result.pushKV("weight", ::GetBlockWeight(block)); UniValue txs(UniValue::VARR); txs.reserve(block.vtx.size());