From: 志宇 Date: Sat, 14 Jun 2025 03:15:48 +0000 (+1000) Subject: feat(chain): Add `TxGraph::get_last_evicted` X-Git-Tag: bitcoind_rpc-0.21.0~8^2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.CommandStringError.html?a=commitdiff_plain;h=b555acb91e30f7134ec2663477b015225140b11b;p=bdk feat(chain): Add `TxGraph::get_last_evicted` Ideally, this would be included as a field in `TxNode`, however that would be a breaking change. --- diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 713b6268..1e2b7ced 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -410,6 +410,13 @@ impl TxGraph { }) } + /// Get the `last_evicted` timestamp of the given `txid`. + /// + /// Ideally, this would be included in [`TxNode`], but that would be a breaking change. + pub fn get_last_evicted(&self, txid: Txid) -> Option { + self.last_evicted.get(&txid).copied() + } + /// Calculates the fee of a given transaction. Returns [`Amount::ZERO`] if `tx` is a coinbase /// transaction. Returns `OK(_)` if we have all the [`TxOut`]s being spent by `tx` in the /// graph (either as the full transactions or individual txouts).