feat(tx_graph): Add method txs_with_no_anchor_or_last_seen

This commit is contained in:
valued mammal
2024-06-25 12:46:53 -04:00
parent 496601b8b1
commit 6204d2c766
3 changed files with 25 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ use bdk_chain::{
self, ApplyHeaderError, CannotConnectError, CheckPoint, CheckPointIter, LocalChain,
},
spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult},
tx_graph::{CanonicalTx, TxGraph},
tx_graph::{CanonicalTx, TxGraph, TxNode},
Append, BlockId, ChainPosition, ConfirmationTime, ConfirmationTimeHeightAnchor, FullTxOut,
Indexed, IndexedTxGraph,
};
@@ -2250,6 +2250,14 @@ impl Wallet {
self.indexed_graph.graph()
}
/// Iterate over transactions in the wallet that are unseen and unanchored likely
/// because they haven't been broadcast.
pub fn unbroadcast_transactions(
&self,
) -> impl Iterator<Item = TxNode<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>> {
self.tx_graph().txs_with_no_anchor_or_last_seen()
}
/// Get a reference to the inner [`KeychainTxOutIndex`].
pub fn spk_index(&self) -> &KeychainTxOutIndex<KeychainKind> {
&self.indexed_graph.index