Backporting "Fix policy condition calculation" onto release/0.28#1008
Merged
notmandatory merged 2 commits intobitcoindevkit:release/0.28from Jun 26, 2023
Merged
Backporting "Fix policy condition calculation" onto release/0.28#1008notmandatory merged 2 commits intobitcoindevkit:release/0.28from
notmandatory merged 2 commits intobitcoindevkit:release/0.28from
Conversation
When constructing the `Condition` struct we recursively call `get_condition` on all the items in a threshold and short-circuit if there's an error somewhere (for example, because the policy-path hasn't been provided for a specific threshold). This can cause issues when the user doesn't care about a subtree, because we still try to call `get_condition` on all the items and fail if something is missing, even if the specific subtree isn't selected and won't be used later on. This commit changes the logic so that we first filter only the `selected` items, and then unwrap the error using the question mark. If errors happened somewhere else they will be ignored, as it should.
Author
|
Also, please let me know if I should point it at a different branch. |
Member
|
Thanks for doing this backport, commit history is fine. Seems to be some tests failing though, I can help take a look if you like. |
Author
|
I found the issue. Everything should build now. |
notmandatory
approved these changes
Jun 26, 2023
Member
notmandatory
left a comment
There was a problem hiding this comment.
ACK 9cffaad
Test fix looks good.
notmandatory
added a commit
to notmandatory/bdk
that referenced
this pull request
Aug 3, 2023
Summary This patch release backports (from the BDK 1.0 dev branch) a fix for a bug in the policy condition calculation and adds a new taproot single key descriptor template (BIP-86). The policy condition calculation bug can cause issues when a policy subtree fails due to missing info even if it's not selected when creating a new transaction, errors on unused policy paths are now ignored. Fixed - Backported bitcoindevkit#932 fix for policy condition calculation bitcoindevkit#1008 Added - Backported bitcoindevkit#840 taproot descriptor template (BIP-86) bitcoindevkit#1033
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.
Fixes #942
Description
This backports "Fix policy condition calculation" (#932) onto release/0.28
Notes to the reviewers
Currently kept the Author the same and the committer is myself. Let me know if this is not the desired outcome of the history. (I have made no modifications myself)
Changelog notice
Backported "Fix policy condition calculation"
Checklists
All Submissions:
cargo fmtandcargo clippybefore committing