Repository navigation
Skip unknown UTXOs when unlocking offline - #356
Closed
emma31-dev wants to merge 1 commit into
Closed
emma31-dev wants to merge 1 commit into
emma31-dev wants to merge 1 commit into
Conversation
Warn and continue instead of unlocking outpoints that aren't known wallet UTXOs.
Collaborator
|
The known behaviour when you test locking and unlocking UTXOs is that, when it locks and unlocks, it returns a json containing count and the items (UTXOs). So when you lock a UTXO, it returns the same output with count incremented and the locked UTXO in the items. Similar response is returned for unlocking a UTXO but this time, it decreases. The same behaviour occurs when you supply a UTXO the wallet doesn't know about whether to lock or unlock. So there is no unexpected behaviour. You can read the entire conversation on the PR here #294. Aside that, it will be more helpful to open an "Issue" whenever you think something is worth fixing/adding so others can share their perspective on the issue first before opening a PR. Thank you. |
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.
Description
Previously,
UnlockUtxoCommandwould attempt to unlock any outpoint passed by the user without checking whether it was actually a known wallet UTXO, which could cause silent no-ops or unexpected behaviour. This change adds a guard that checks each outpoint against the wallet's known UTXOs viaget_utxobefore callingunlock_outpointjust likeLockUtxoCommand. if an outpoint is not recognised, a warning is printed to stderr and that entry is skipped, allowing the rest of the list to be processed normally.Checklists
All Submissions:
cargo fmtandcargo clippybefore committing