fix(connect): don't block PSBT approval for already-signed own inputs - #6
Merged
Merged
Conversation
enrichPsbt's "none of this belongs to you" blocker was keyed off signableCount, which excludes inputs that already carry a valid partial signature. A PSBT whose wallet-owned inputs are all already signed but not yet finalized (e.g. mid multi-party hand-off) tripped the wrong blocker with a misleading reason and no way to proceed. Base the check on whether any input is recognized as ours at all (mineCount), regardless of already-signed status, instead.
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.
Summary
Addresses one finding from the #5 code review:
enrichPsbt's "none of this transaction's inputs belong to your wallet" blocker was keyed offsignableCount, which deliberately excludes inputs that already carry a valid partial signature. That means a PSBT whose wallet-owned inputs are all already signed but not yet finalized (e.g. mid multi-party hand-off, or simply re-opening a request the wallet already signed) tripped the blocker with a misleading reason and no way to proceed — even though the wallet has a legitimate stake in the transaction.The blocker now checks
mineCount(any input recognized as ours, regardless of already-signed status) instead, whilesignableCountkeeps its original meaning for the "N of your inputs will be signed" display text.Test plan
tsc --noEmitclean inpackages/apppnpm --filter @photonic/app test— 522 passed