@@ -220,6 +220,8 @@ pub struct TxNode<'a, T, A> {
220
220
pub first_seen : Option < u64 > ,
221
221
/// The last-seen unix timestamp of the transaction as unconfirmed.
222
222
pub last_seen : Option < u64 > ,
223
+ /// The last-evicted-from-mempool unix timestamp of the transaction.
224
+ pub last_evicted : Option < u64 > ,
223
225
}
224
226
225
227
impl < T , A > Deref for TxNode < ' _ , T , A > {
@@ -342,6 +344,7 @@ impl<A> TxGraph<A> {
342
344
anchors : self . anchors . get ( & txid) . unwrap_or ( & self . empty_anchors ) ,
343
345
first_seen : self . first_seen . get ( & txid) . copied ( ) ,
344
346
last_seen : self . last_seen . get ( & txid) . copied ( ) ,
347
+ last_evicted : self . last_evicted . get ( & txid) . copied ( ) ,
345
348
} ) ,
346
349
TxNodeInternal :: Partial ( _) => None ,
347
350
} )
@@ -378,6 +381,7 @@ impl<A> TxGraph<A> {
378
381
anchors : self . anchors . get ( & txid) . unwrap_or ( & self . empty_anchors ) ,
379
382
first_seen : self . first_seen . get ( & txid) . copied ( ) ,
380
383
last_seen : self . last_seen . get ( & txid) . copied ( ) ,
384
+ last_evicted : self . last_evicted . get ( & txid) . copied ( ) ,
381
385
} ) ,
382
386
_ => None ,
383
387
}
@@ -410,13 +414,6 @@ impl<A> TxGraph<A> {
410
414
} )
411
415
}
412
416
413
- /// Get the `last_evicted` timestamp of the given `txid`.
414
- ///
415
- /// Ideally, this would be included in [`TxNode`], but that would be a breaking change.
416
- pub fn get_last_evicted ( & self , txid : Txid ) -> Option < u64 > {
417
- self . last_evicted . get ( & txid) . copied ( )
418
- }
419
-
420
417
/// Calculates the fee of a given transaction. Returns [`Amount::ZERO`] if `tx` is a coinbase
421
418
/// transaction. Returns `OK(_)` if we have all the [`TxOut`]s being spent by `tx` in the
422
419
/// graph (either as the full transactions or individual txouts).
0 commit comments