Skip to content

Commit 808a708

Browse files
committed
rpc: add entry time to getorphantxs
1 parent 56bf302 commit 808a708

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
@@ -823,6 +823,7 @@ static std::vector<RPCResult> OrphanDescription()
823823
RPCResult{RPCResult::Type::NUM, "bytes", "The serialized transaction size in bytes"},
824824
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."},
825825
RPCResult{RPCResult::Type::NUM, "weight", "The transaction weight as defined in BIP 141."},
826+
RPCResult{RPCResult::Type::NUM_TIME, "entry", "The entry time into the orphanage expressed in " + UNIX_EPOCH_TIME},
826827
RPCResult{RPCResult::Type::NUM_TIME, "expiration", "The orphan expiration time expressed in " + UNIX_EPOCH_TIME},
827828
RPCResult{RPCResult::Type::ARR, "from", "",
828829
{
@@ -839,6 +840,7 @@ static UniValue OrphanToJSON(const TxOrphanage::OrphanTxBase& orphan)
839840
o.pushKV("bytes", orphan.tx->GetTotalSize());
840841
o.pushKV("vsize", GetVirtualTransactionSize(*orphan.tx));
841842
o.pushKV("weight", GetTransactionWeight(*orphan.tx));
843+
o.pushKV("entry", int64_t{TicksSinceEpoch<std::chrono::seconds>(orphan.nTimeExpire - ORPHAN_TX_EXPIRE_TIME)});
842844
o.pushKV("expiration", int64_t{TicksSinceEpoch<std::chrono::seconds>(orphan.nTimeExpire)});
843845
UniValue from(UniValue::VARR);
844846
from.push_back(orphan.fromPeer); // only one fromPeer for now

0 commit comments

Comments
 (0)