Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Listen::filtered_block_connected for Wallet #433

Closed

Conversation

rustaceanrob
Copy link
Contributor

While apply_block works in the case of bitcoind RPC, chain sources that do not emit every block cannot make use of apply_block. Inserting the intermediate hashes allows apply_block to reconcile where to extend a block in the local chain representation.

ref: https://github.com/bitcoindevkit/bdk/blob/master/crates/wallet/src/test_utils.rs#L297

While `apply_block` works in the case of bitcoind RPC, chain sources that
do not emit every block cannot make use of `apply_block`. Inserting the
intermediate hashes allows `apply_block` to reconsile where to extend a
block in the local chain representation.

ref: https://github.com/bitcoindevkit/bdk/blob/master/crates/wallet/src/test_utils.rs#L297
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I assume you have a PR coming up making use of this? I wonder if we should include this commit in that PR, so that we directly have some code to test this is working as expected?

let update = Update { tx_update, chain: Some(cp), ..Default::default() };

match locked_wallet.apply_update(update) {
Ok(()) => (),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to persist the wallet in the success case here (see Self::apply_update).

@rustaceanrob
Copy link
Contributor Author

so that we directly have some code to test this is working as expected?

Sure, this is hard to test without a chain source that can make use of it. Closing in favor of adding it as a commit in a future PR.

@rustaceanrob rustaceanrob deleted the wallet-listen-1-16 branch January 17, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants