-
Notifications
You must be signed in to change notification settings - Fork 37.5k
wallet, rpc: add anti-fee-sniping to send
and sendall
#28944
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
base: master
Are you sure you want to change the base?
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/28944. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. LLM Linter (✨ experimental)Possible typos and grammar issues:
drahtbot_id_4_m |
b8e489a
to
5c9ac14
Compare
Concept ACK |
ACK 5c9ac14 A test for |
5c9ac14
to
5101f05
Compare
Done |
5101f05
to
f348ead
Compare
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.
ACK f348ead
f348ead
to
a5ef4e2
Compare
a5ef4e2
to
d76f880
Compare
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.
Concept ACK and almost crACK d76f880 except that there seems to be a type mix-up:
wallet/rpc/spend.cpp:1299:20: error: no matching function for call to 'FinishTransaction'
return FinishTransaction(pwallet, options, CMutableTransaction(*txr.tx));
^~~~~~~~~~~~~~~~~
wallet/rpc/spend.cpp:79:17: note: candidate function not viable: expects an lvalue for 3rd argument
static UniValue FinishTransaction(const std::shared_ptr<CWallet> pwallet, const UniValue& options, CMutableTransaction& rawTx)
^
1 error generated.
d76f880
to
c8de459
Compare
Fixed silent merge conflict. |
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.
ACK c8de459
c8de459
to
ed5cc12
Compare
I pushed this change, but I had forgotten to comment until later. |
} | ||
|
||
if (can_anti_fee_snipe) { | ||
LOCK(pwallet->cs_wallet); |
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'm not clear why do we need a wallet lock here?
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.
Here the wallet is locked because it runs CWallet::GetLastBlockHash
and CWallet::GetLastBlockHeight
which both require pwallet->cs_wallet
to be locked.
fa1fa35
to
b11d00d
Compare
…niping is compatible with transaction Currently DiscourageFeeSniping will assert unless sequences are all either MAX_SEQUENCE_NONFINAL or MAX_BIP125_RBF_SEQUENCE. Github-Pull: bitcoin#28944 Rebased-From: 6825ae0
…sequences is final Github-Pull: bitcoin#28944 Rebased-From: b11d00d
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.
crACK b11d00d
CMutableTransaction tx = CMutableTransaction(*txr.tx); | ||
return FinishTransaction(pwallet, options, tx); |
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.
It’s not clear to me why this change was made. It does not seem to be affecting function, is this just for readability?
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.
Because FinishTransaction
now takes a CMutableTransaction&
instead of a const CMutableTransaction&
, we can't give it an rvalue.
Needs rebase, if still relevant. |
b11d00d
to
6f30f22
Compare
Hey @ishaanam, I noticed that this PR was rebased, but it is still set to Draft. Should this be marked as ready for review? |
6f30f22
to
aac0b6d
Compare
Concept ACK. Discovered this after I tried to implement it myself in #32892 :-) I might be useful to borrow the idea from 642e4b6 of renaming In |
Currently,
send
andsendall
don't do anti-fee-sniping because they don't useCreateTransaction
. This PR adds anti-fee-sniping to these RPCs by callingDiscourageFeeSniping
fromFinishTransaction
when the user does not specify a locktime.