diff options
author | jonnynewbs <jonnynewbs@gmail.com> | 2016-09-21 20:51:00 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-04-28 10:01:56 -0400 |
commit | 0ff9320bf5b60968669269b05b0eba65dd69c6b6 (patch) | |
tree | eac1dd4f4bd2efd2ef144528fa967557ea3030d5 /src/core_write.cpp | |
parent | 4c924011f535c46b3bc02bef8b7e2a8ad559d78d (diff) |
refactor TxToJSON() and ScriptPubKeyToJSON()
Diffstat (limited to 'src/core_write.cpp')
-rw-r--r-- | src/core_write.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core_write.cpp b/src/core_write.cpp index a3ca87c8b5..d116e617ee 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -151,6 +151,8 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) entry.pushKV("txid", tx.GetHash().GetHex()); entry.pushKV("hash", tx.GetWitnessHash().GetHex()); entry.pushKV("version", tx.nVersion); + entry.pushKV("size", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)); + entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR); entry.pushKV("locktime", (int64_t)tx.nLockTime); UniValue vin(UniValue::VARR); |