We need a set of APIs to easily apply blocks to a keychain tracker. I propse the following:
ChainGraph::<ConfirmationTime>::from_block(block): This creates a chain graph with two checkpoints (one for the block at height and one for prev block hash).
KeychainTracker::apply_update_relevant(scan: KeychainScan), does this same thing as apply_update but doesn't not take transactions that don't send to or from things in the txout index. Also add determine_relevant_changeset.
ChainGraph::apply_update_relevant(|tx| is_this_relevant(tx)) same as above except you can pass a predicate (also needs the changeset option).
In addition to adding these APIs it looks like KeychainTracker::determine_changeset has a TODO in it that needs to be fixed before this whole workflow will work properly:
We need a set of APIs to easily apply blocks to a keychain tracker. I propse the following:
ChainGraph::<ConfirmationTime>::from_block(block)
: This creates a chain graph with two checkpoints (one for the block at height and one for prev block hash).KeychainTracker::apply_update_relevant(scan: KeychainScan)
, does this same thing asapply_update
but doesn't not take transactions that don't send to or from things in the txout index. Also adddetermine_relevant_changeset
.ChainGraph::apply_update_relevant(|tx| is_this_relevant(tx))
same as above except you can pass a predicate (also needs the changeset option).In addition to adding these APIs it looks like
KeychainTracker::determine_changeset
has a TODO in it that needs to be fixed before this whole workflow will work properly:https://github.com/LLFourn/bdk_core_staging/blob/0fb4e1b20c4d31ecb785509311124d3fc4222902/bdk_chain/src/keychain/keychain_tracker.rs#L73
I'm also open to other suggestions :)