From 808a708107e65e52f54373d2e26f807cf1e444e1 Mon Sep 17 00:00:00 2001 From: tdb3 <106488469+tdb3@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:25:05 -0400 Subject: [PATCH] rpc: add entry time to getorphantxs --- src/rpc/mempool.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp index 9a6a8d87756..7bdbd35ec42 100644 --- a/src/rpc/mempool.cpp +++ b/src/rpc/mempool.cpp @@ -823,6 +823,7 @@ static std::vector OrphanDescription() RPCResult{RPCResult::Type::NUM, "bytes", "The serialized transaction size in bytes"}, 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."}, RPCResult{RPCResult::Type::NUM, "weight", "The transaction weight as defined in BIP 141."}, + RPCResult{RPCResult::Type::NUM_TIME, "entry", "The entry time into the orphanage expressed in " + UNIX_EPOCH_TIME}, RPCResult{RPCResult::Type::NUM_TIME, "expiration", "The orphan expiration time expressed in " + UNIX_EPOCH_TIME}, RPCResult{RPCResult::Type::ARR, "from", "", { @@ -839,6 +840,7 @@ static UniValue OrphanToJSON(const TxOrphanage::OrphanTxBase& orphan) o.pushKV("bytes", orphan.tx->GetTotalSize()); o.pushKV("vsize", GetVirtualTransactionSize(*orphan.tx)); o.pushKV("weight", GetTransactionWeight(*orphan.tx)); + o.pushKV("entry", int64_t{TicksSinceEpoch(orphan.nTimeExpire - ORPHAN_TX_EXPIRE_TIME)}); o.pushKV("expiration", int64_t{TicksSinceEpoch(orphan.nTimeExpire)}); UniValue from(UniValue::VARR); from.push_back(orphan.fromPeer); // only one fromPeer for now