Skip to content

Commit 54aaa78

Browse files
esotericnonsensefanquake
authored andcommitted
RPC: add weight to mempool entry output
1 parent 48e5bfe commit 54aaa78

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpc/blockchain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ static std::string EntryDescriptionString()
374374
return " \"vsize\" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.\n"
375375
" \"size\" : n, (numeric) (DEPRECATED) same as vsize. Only returned if bitcoind is started with -deprecatedrpc=size\n"
376376
" size will be completely removed in v0.20.\n"
377+
" \"weight\" : n, (numeric) transaction weight as defined in BIP 141.\n"
377378
" \"fee\" : n, (numeric) transaction fee in " + CURRENCY_UNIT + " (DEPRECATED)\n"
378379
" \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)\n"
379380
" \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n"
@@ -413,6 +414,7 @@ static void entryToJSON(const CTxMemPool& pool, UniValue& info, const CTxMemPool
413414

414415
info.pushKV("vsize", (int)e.GetTxSize());
415416
if (IsDeprecatedRPCEnabled("size")) info.pushKV("size", (int)e.GetTxSize());
417+
info.pushKV("weight", (int)e.GetTxWeight());
416418
info.pushKV("fee", ValueFromAmount(e.GetFee()));
417419
info.pushKV("modifiedfee", ValueFromAmount(e.GetModifiedFee()));
418420
info.pushKV("time", e.GetTime());

0 commit comments

Comments
 (0)