Validate tx signature before adding to wallet. - #2643
Merged
Merged
Conversation
Unmined transaction with inputs which reference UTXOs owned by this wallet require extra scrutiny before the transaction is accepted into the mempool/database. This is necessary because a malicious SPV peer could relay a forged transaction which falsely claims to spend a UTXO from this wallet. Mined transactions do not need these extra checks because they have already been validated by consensus.
Member
I don't think that changes anything though. I'll explain offline to keep the details out of here. |
A peer which relays a transaction with an invalid attempt to spend a UTXO owned by this wallet is misbehaving, so drop the peer instead of allowing it to keep announcing the invalid transaction.
jholdstock
force-pushed
the
drop-invalid
branch
from
August 5, 2026 08:12
0bd4b23 to
49b56b3
Compare
Member
Author
|
Updated so peers are only disconnected if they claim to be a full node. |
davecgh
approved these changes
Aug 5, 2026
jrick
approved these changes
Aug 18, 2026
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.
Validate transactions which spend UTXOs owned by this wallet before adding them to the mempool/database. Disconnect peers violating the validation.
Closes #2633
@davecgh - to address your concern from #2642 (comment),
AddTransactionwas not previously capable of returningerrors.ScriptFailure, so only the code newly added in this PR will lead to peers being disconnected.