wallet: Add sanity checks to DiscourageFeeSniping#24225
wallet: Add sanity checks to DiscourageFeeSniping#24225achow101 merged 1 commit intobitcoin:masterfrom
Conversation
|
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. |
S3RK
left a comment
There was a problem hiding this comment.
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 |
w0xlt
left a comment
There was a problem hiding this comment.
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.
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.
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)locktimecast with the equivalentint(locktime)cast.