Browse Source

Return size in bytes of a tx from getrawtransaction

pull/305/head
Jonathan "Duke" Leto 2 years ago
parent
commit
0a9abedc5d
  1. 2
      src/rpc/rawtransaction.cpp

2
src/rpc/rawtransaction.cpp

@ -367,6 +367,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp, const CPubKey& my
"\nResult (if verbose > 0):\n"
"{\n"
" \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n"
" \"size\" : n, (numeric) The length in bytes\n"
" \"txid\" : \"id\", (string) The transaction id (same as provided)\n"
" \"version\" : n, (numeric) The version\n"
" \"locktime\" : ttt, (numeric) The lock time\n"
@ -453,6 +454,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp, const CPubKey& my
UniValue result(UniValue::VOBJ);
result.push_back(Pair("hex", strHex));
result.push_back(Pair("size", GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) ));
TxToJSONExpanded(tx, hashBlock, result, nHeight, nConfirmations, nBlockTime);
return result;
}

Loading…
Cancel
Save