-
Notifications
You must be signed in to change notification settings - Fork 37.7k
rpc: use anti-fee-sniping in send, sendall and walletcreatefundedpsbt #32892
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32892. ReviewsSee the guideline for information on the review process. 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. |
If the user does not specify 'locktime' for send and walletcreatefundedpsbt, enable anti-fee-sniping. This matches sendtoaddress RPC behavior and the GUI wallet.
Rename and refactor DiscourageFeeSniping such that it can determine by itself whether to apply anti fee sniping. This makes it easier to use outside of CreateTransactionInternal.
Expanded the existing |
Any chance this is a duplicate of #28944? |
@glozow thanks, I hadn't seen that one. Will take a look. |
Ok, so #28944 uses a completely different approach. It already has a lot of review, so I'll add mine there. |
Github-Pull: bitcoin#32892 Rebased-From: c8a73f3
Github-Pull: bitcoin#32892 Rebased-From: 4bc0858 (tests only)
If the user does not specify
locktime
forsend
,sendall
andwalletcreatefundedpsbt
, enable anti-fee-sniping. Previously we would setnLockTime
to 0.This behavior matches the
sendtoaddress
RPC and the GUI wallet.Because
sendall
doesn't useCreateTransactionInternal
this PR refactors (and renames)DiscourageFeeSniping
so that it checks inputnSequence
values and nLockTime by itself, and brings its ownFastRandomContext
. A subsequent commit then calls this from thesendall
RPC.