-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix malleability check in mempool #470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads correct.
Having a test case for this could be helpful. |
fc2c3a8
to
a9193f0
Compare
This comment has been minimized.
This comment has been minimized.
Added test case and description of the issue. |
fec6248
to
f0023cb
Compare
Regarding the "... DoS risk in segwit due to malleated transactions" issue (bitcoin/bitcoin#8279), it looks like there were tests added here 72597c9 to check that malleated witness transactions (without witness) are not added to the reject cache (as resolved similarly by bitcoin/bitcoin#8525). |
Yes, these tests are still there but still missed this case. This bug was introduced on refactor 01f21b0 |
Okay, yep. Before refactor 01f21b0:
After refactor 01f21b0:
With this PR, goes back to before the refactor:
|
fix malleability check in mempool
Checks in verify in this block are related to
witness
malleability.Discussion: bitcoin/bitcoin#8279
Summary of the issue:
We may have received witness transaction from old node (without witness) or even with malleated witness, but we don't want to reject those transactions in the mempool. But we still want to detect non standard transactions, that are non-witness.
In case of witness transaction,
verifyResult
will fail because there is no witness. But if there's no error with VERIFY_WITNESS, it means we have CLEANSTACK issue and transaction is not standard one.Without this check, it would not reject non-standard P2SH from the mempool reject cache.