Skip to content

Commit b555acb

Browse files
committed
feat(chain): Add TxGraph::get_last_evicted
Ideally, this would be included as a field in `TxNode`, however that would be a breaking change.
1 parent e5f25a8 commit b555acb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/chain/src/tx_graph.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,13 @@ impl<A> TxGraph<A> {
410410
})
411411
}
412412

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+
413420
/// Calculates the fee of a given transaction. Returns [`Amount::ZERO`] if `tx` is a coinbase
414421
/// transaction. Returns `OK(_)` if we have all the [`TxOut`]s being spent by `tx` in the
415422
/// graph (either as the full transactions or individual txouts).

0 commit comments

Comments
 (0)