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
wallet: Add sanity checks to DiscourageFeeSniping #24225
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.
light-utACK.. I'm not super familiar with this part of codebase, but generally looks correct
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
Code review ACK. Changes look good
fa32fb0
to
fa8e76b
Compare
Code review is fine. I compiled the PR and created a transaction on regtest, which seemed to go well. I added my own print statement to check that the ACK fa8e76b |
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.
Code Review ACK fa8e76b
DiscourageFeeSniping
better describes the purpose of the function than GetLocktimeForNewTransaction
.
Passing the transaction as an argument allows sanity checking on the inputs in
DiscourageFeeSniping
function.
@S3RK Mind doing a quick re-ACK? |
Code review ACK fa8e76b |
ACK fa8e76b |
// The wallet does not support any other sequence-use right now. | ||
assert(false); |
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.
This is fine for now, but it could be problematic if the sequence of preset inputs and the existing locktime were passed into the newly created transaction. Currently, we don't do that, but we might need to do that later for miniscript.
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.
I added those sanity checks as part of implementing BIP 326, but I think they make sense on their own. The checks require the transaction to be passed in to
DiscourageFeeSniping
. Also, replace(int)locktime
cast with the equivalentint(locktime)
cast.