Skip to content

Commit 23dfd6e

Browse files
committed
Merge #1977: Add TxGraph::get_last_evicted
b555acb feat(chain): Add `TxGraph::get_last_evicted` (志宇) Pull request description: ### Description Ideally, this would be included as a field in `TxNode`, however that would be a breaking change. ### Changelog notice ```md Added - `TxGraph::get_last_evicted` ``` ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing #### New Features: ~* [ ] I've added tests for the new feature~ * [x] I've added docs for the new feature ACKs for top commit: evanlinjin: self-ACK b555acb Tree-SHA512: f1661d204e89e400b93e17f51f890a591edcdeea95803c4c48b937b700f48d5f2d975fcf33def3c5e36df13809ac2cc75f99ffc99716fa38c356b253a61eb5cb
2 parents e5f25a8 + b555acb commit 23dfd6e

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)