Skip to content

Commit f9d0781

Browse files
tdb3luke-jr
authored andcommitted
rpc: add entry time to getorphantxs
Github-Pull: bitcoin#31043 Rebased-From: 808a708
1 parent 700c917 commit f9d0781

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpc/mempool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ static std::vector<RPCResult> OrphanDescription()
862862
RPCResult{RPCResult::Type::NUM, "bytes", "The serialized transaction size in bytes"},
863863
RPCResult{RPCResult::Type::NUM, "vsize", "The virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted."},
864864
RPCResult{RPCResult::Type::NUM, "weight", "The transaction weight as defined in BIP 141."},
865+
RPCResult{RPCResult::Type::NUM_TIME, "entry", "The entry time into the orphanage expressed in " + UNIX_EPOCH_TIME},
865866
RPCResult{RPCResult::Type::NUM_TIME, "expiration", "The orphan expiration time expressed in " + UNIX_EPOCH_TIME},
866867
RPCResult{RPCResult::Type::ARR, "from", "",
867868
{
@@ -878,6 +879,7 @@ static UniValue OrphanToJSON(const TxOrphanage::OrphanTxBase& orphan)
878879
o.pushKV("bytes", orphan.tx->GetTotalSize());
879880
o.pushKV("vsize", GetVirtualTransactionSize(*orphan.tx));
880881
o.pushKV("weight", GetTransactionWeight(*orphan.tx));
882+
o.pushKV("entry", int64_t{TicksSinceEpoch<std::chrono::seconds>(orphan.nTimeExpire - ORPHAN_TX_EXPIRE_TIME)});
881883
o.pushKV("expiration", int64_t{TicksSinceEpoch<std::chrono::seconds>(orphan.nTimeExpire)});
882884
UniValue from(UniValue::VARR);
883885
from.push_back(orphan.fromPeer); // only one fromPeer for now

0 commit comments

Comments
 (0)