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.
This commit is contained in:
MarcoFalke committed 2025-10-28 16:08:39 +01:00
1 parent fa364af89b
commit fa2bbc9e4c
1 file changed
+3 -3
+3 -3
View File
@@ -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());