fix(bitcoin-wallet-snap): preserve template output order when filling a PSBT - #157
Draft
jeremytsng wants to merge 1 commit into
Draft
fix(bitcoin-wallet-snap): preserve template output order when filling a PSBT#157jeremytsng wants to merge 1 commit into
jeremytsng wants to merge 1 commit into
Conversation
jeremytsng
force-pushed
the
fix/btc-output-reordering-fx-fail
branch
from
August 17, 2026 16:57
d5812af to
30f6166
Compare
… a PSBT Only treat a wallet-owned template output as the drain output when it is the last output. BDK appends the drain output, so a wallet-owned output placed anywhere earlier was silently moved to the end of the transaction, reordering templates that put change before another output. Verify the built transaction against the template before returning it: every template output must appear at its original index with its original script and value, except the drain output, which takes the excess. The previous check compared only the number of outputs, so a transaction whose outputs diverged from the template could still be signed and broadcast.
jeremytsng
force-pushed
the
fix/btc-output-reordering-fx-fail
branch
from
August 17, 2026 17:03
30f6166 to
54d49c5
Compare
4 tasks
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.
No description provided.