aboutsummaryrefslogtreecommitdiff
path: root/src/core_write.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2018-03-26 11:20:56 -0400
committerMatt Corallo <git@bluematt.me>2018-04-13 15:18:26 -0400
commit2874709a9f23d16eacfee1e53fadaff8081f16e6 (patch)
tree31a26ab89bec62e7d13aea8d1888ab883e4bec38 /src/core_write.cpp
parent5f2a39946fd42535038e0143cbd289d3070b9f07 (diff)
downloadbitcoin-2874709a9f23d16eacfee1e53fadaff8081f16e6.tar.xz
Expose a transaction's weight via RPC
Diffstat (limited to 'src/core_write.cpp')
-rw-r--r--src/core_write.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core_write.cpp b/src/core_write.cpp
index 54b18a4931..929498ff28 100644
--- a/src/core_write.cpp
+++ b/src/core_write.cpp
@@ -161,6 +161,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
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("weight", GetTransactionWeight(tx));
entry.pushKV("locktime", (int64_t)tx.nLockTime);
UniValue vin(UniValue::VARR);