mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user