[bdk_chain_redesign] Modify signature of TxIndex

This makes the API of `TxIndex` more consistent between scanning in data
and checking whether certain data is relevant.
This commit is contained in:
志宇 committed 2023-04-05 18:17:08 +08:00
1 parent da4cef044d
commit ddd5e951f5
5 files changed
+15 -16

No files matched your search

+4 -4
View File
@@ -105,12 +105,12 @@ impl<K: Clone + Ord + Debug + 'static> TxIndex for KeychainTxOutIndex<K> {
self.apply_additions(additions)
}
fn is_tx_relevant(&self, tx: &bitcoin::Transaction) -> bool {
self.is_relevant(tx)
fn is_txout_relevant(&self, _outpoint: OutPoint, txout: &TxOut) -> bool {
self.index_of_spk(&txout.script_pubkey).is_some()
}
fn is_spk_owned(&self, spk: &Script) -> bool {
self.index_of_spk(spk).is_some()
fn is_tx_relevant(&self, tx: &bitcoin::Transaction) -> bool {
self.is_relevant(tx)
}
}