Implement Listen::filtered_block_connected for Wallet#433
Closed
rustaceanrob wants to merge 1 commit intolightningdevkit:mainfrom
Closed
Implement Listen::filtered_block_connected for Wallet#433rustaceanrob wants to merge 1 commit intolightningdevkit:mainfrom
Listen::filtered_block_connected for Wallet#433rustaceanrob wants to merge 1 commit intolightningdevkit:mainfrom
Conversation
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
tnull
reviewed
Jan 17, 2025
Collaborator
tnull
left a comment
There was a problem hiding this comment.
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(()) => (), |
Collaborator
There was a problem hiding this comment.
We need to persist the wallet in the success case here (see Self::apply_update).
Contributor
Author
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While
apply_blockworks in the case of bitcoind RPC, chain sources that do not emit every block cannot make use ofapply_block. Inserting the intermediate hashes allowsapply_blockto 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