@@ -62,6 +62,7 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fInclud
62
62
void TxToJSON (const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
63
63
{
64
64
entry.push_back (Pair (" txid" , tx.GetHash ().GetHex ()));
65
+ entry.push_back (Pair (" size" , (int )::GetSerializeSize (tx, SER_NETWORK, PROTOCOL_VERSION)));
65
66
entry.push_back (Pair (" version" , tx.nVersion ));
66
67
entry.push_back (Pair (" locktime" , (int64_t )tx.nLockTime ));
67
68
UniValue vin (UniValue::VARR);
@@ -133,6 +134,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp)
133
134
" {\n "
134
135
" \" hex\" : \" data\" , (string) The serialized, hex-encoded data for 'txid'\n "
135
136
" \" txid\" : \" id\" , (string) The transaction id (same as provided)\n "
137
+ " \" size\" : n, (numeric) The transaction size\n "
136
138
" \" version\" : n, (numeric) The version\n "
137
139
" \" locktime\" : ttt, (numeric) The lock time\n "
138
140
" \" vin\" : [ (array of json objects)\n "
@@ -429,6 +431,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp)
429
431
" \n Result:\n "
430
432
" {\n "
431
433
" \" txid\" : \" id\" , (string) The transaction id\n "
434
+ " \" size\" : n, (numeric) The transaction size\n "
432
435
" \" version\" : n, (numeric) The version\n "
433
436
" \" locktime\" : ttt, (numeric) The lock time\n "
434
437
" \" vin\" : [ (array of json objects)\n "
0 commit comments