bdk
bdk copied to clipboard
KeychainTxOutIndex method should behave consistently when non-existent keychains are passed in as arguments
Some KeychainTxOutIndex methods panic if a non-existent keychain is passed in as an argument. Some examples include:
unbounded_spk_iternext_index
Instead, the methods that return an iterator simply return an empty one. Some examples are:
keychain_outpointsunused_keychain_spks
I think we should be consistent, and either panic everywhere, or return a Result/Option everywhere. I personally don't like returning empty iterators, as the mistake of passing a non-existent keychain might be overlooked.
More discussion here: https://github.com/bitcoindevkit/bdk/pull/1203#discussion_r1474319073
Can I work on this? Although I will need some briefing
starting work on this will need to wait until #1203 is merged.
Looks like this was also fixed in #1203.