use crate::{
collections::*,
- indexed_tx_graph::Indexer,
+ indexed_tx_graph::{Indexer, OwnedIndexer},
miniscript::{Descriptor, DescriptorPublicKey},
ForEachTxOut, SpkTxOutIndex,
};
}
}
+impl<K: Clone + Ord + Debug + 'static> OwnedIndexer for KeychainTxOutIndex<K> {
+ fn is_spk_owned(&self, spk: &Script) -> bool {
+ self.inner().is_spk_owned(spk)
+ }
+}
+
impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
/// Scans an object for relevant outpoints, which are stored and indexed internally.
///
use crate::{
collections::{hash_map::Entry, BTreeMap, BTreeSet, HashMap},
- indexed_tx_graph::Indexer,
+ indexed_tx_graph::{Indexer, OwnedIndexer},
ForEachTxOut,
};
use bitcoin::{self, OutPoint, Script, Transaction, TxOut, Txid};
}
}
+impl<I: Clone + Ord + 'static> OwnedIndexer for SpkTxOutIndex<I> {
+ fn is_spk_owned(&self, spk: &Script) -> bool {
+ self.spk_indices.get(spk).is_some()
+ }
+}
+
/// This macro is used instead of a member function of `SpkTxOutIndex`, which would result in a
/// compiler error[E0521]: "borrowed data escapes out of closure" when we attempt to take a
/// reference out of the `ForEachTxOut` closure during scanning.