Skip to content

Commit

Permalink
Add transaction size to RPC output
Browse files Browse the repository at this point in the history
This adds transaction sizes in bytes to the output of these RPC
functions:

 - gettransaction
 - getrawtransaction
 - decoderawtransaction
 - getblock true
  • Loading branch information
cyrossignol committed Nov 15, 2020
1 parent 7ea09f3 commit 6c664ac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/rpcrawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
{
entry.pushKV("txid", tx.GetHash().GetHex());
entry.pushKV("version", tx.nVersion);
entry.pushKV("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION));
entry.pushKV("time", (int)tx.nTime);
entry.pushKV("locktime", (int)tx.nLockTime);
entry.pushKV("hashboinc", tx.hashBoinc);
Expand Down

0 comments on commit 6c664ac

Please sign in to comment.