wallet/rpc: sendrawtransaction maxfeerate#13541
Conversation
718aa0b to
43d2cce
Compare
|
Your PR show me actually that One could say that changing ACK. (That said, I think this would be better in |
Yes, absurdfee can actually be specified for each call to
I think having a configurable default maxtxfee would be a good idea. Perhaps this function should then ignore the default if the user does
It fits better here, because it already has the functionality needed in the |
There was a problem hiding this comment.
Alternative (not tested)
vout = next(o for o in rawTx['vout'] if o['value'] == Decimal('1.00000000'))There was a problem hiding this comment.
Several copies of this in rpc_rawtransaction, so I made a dedicated commit to address the others.
src/rpc/rawtransaction.cpp
Outdated
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
When specifying maxfeerate does it make sense to pass allowhighfees=true?
There was a problem hiding this comment.
I am sort of overriding allowhighfees right now. I could disallow it completely, i.e. require that it is null or false, if using maxfeerate, but not sure it's worth it.
There was a problem hiding this comment.
To more directly answer your question, though, allowhighfees=true will simply remove the existing absurd fee cap (which is 0.1 btc I believe), so if maxfeerate was really high, it actually could result in a slightly higher cap.
There was a problem hiding this comment.
Just have a single parameter... if it's a boolean, it's the (deprecated?) allowhighfees; if a number, then a specific limit.
There was a problem hiding this comment.
does that work with named parameters?
Yes, it is already used by getbalance:
bitcoin/src/wallet/rpcwallet.cpp
Line 4784 in 222e627
bbb81b6 to
a43e61d
Compare
f9893d4 to
bec1abd
Compare
d562cce to
dbd466c
Compare
|
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. |
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Shouldn't this default be whatever maxTxFee is, not ∞?
There was a problem hiding this comment.
Fixed - it now outputs
2. allowhighfees|maxfeerate (boolean/numeric, optional, default=false/0.10) Allow
high fees (boolean) or reject transactions whose fee rate is higher than the
specified value (numeric), expressed in BTC/kB
for the default settings.
src/rpc/rawtransaction.cpp
Outdated
There was a problem hiding this comment.
Might be good to add a quick comment here to clarify the +3/4 is for rounding
1a81743 to
da1234d
Compare
|
@MarcoFalke Squashed. |
b202e25 to
6c17985
Compare
|
re-utACK 6c17985e8b |
maflcko
left a comment
There was a problem hiding this comment.
Just some style nits (could be ignored)
6c17985 to
7abd2e6
Compare
|
Addressed @MarcoFalke nits. |
7abd2e6 wallet/rpc: add maxfeerate parameter to testmempoolaccept (Karl-Johan Alm) 6c0a6f7 wallet/rpc: add maxfeerate parameter to sendrawtransaction (Karl-Johan Alm) e5efacb test: Refactor vout fetches in rpc_rawtransaction (Karl-Johan Alm) Pull request description: This adds a new `maxfeerate` parameter to `sendrawtransaction` which forces the node to reject a transaction whose feerate is above the given fee rate. This is a safety harness from shooting yourself in the foot and accidentally overpaying fees. See also #12911. Tree-SHA512: efa50134a7c17c9330cfdfd48ba400e095c0a419cc45e630618d8b44929c25d780d1bb2710c1fbbb6e687eca373505b0338cdaa7f2ff4ca22636d84c31557a2e
| } | ||
| } | ||
| return -1; | ||
| } |
There was a problem hiding this comment.
re-utACK 7abd2e6
Sorry I only noticed this unused method in this hunk after merge 😿.
fa5c511 refactor: Remove unused function (MarcoFalke) Pull request description: Oversight of kallewoof and mine in #13541 (comment) Tree-SHA512: 2fd3c4ecde5d3c58b113aa58d606976ceb4998358bde0547ead8e83df210722fa9821d2c88b717bdd190ef71593cd9c0154c3a5d3f2ccc3af8cbf6c36aaa6d45
|
post-merge ACK 7abd2e6 (except the change to validation.cpp 🙈 ) |
Github-Pull: bitcoin#13541 Rebased-From: 6c0a6f7 Modifications: - Includes fix from bitcoin#15618 - Retains backward compatibility - Doesn't change all the unrelated tests
Github-Pull: bitcoin#13541 Rebased-From: 7abd2e6 Modifications: - Retains backward compatibility
Summary: * test: Refactor vout fetches in rpc_rawtransaction * wallet/rpc: add maxfeerate parameter to sendrawtransaction * wallet/rpc: add maxfeerate parameter to testmempoolaccept This is a backport of Core [[bitcoin/bitcoin#13541 | PR13541]] Test Plan: ninja all check-all Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Subscribers: majcosta Differential Revision: https://reviews.bitcoinabc.org/D6263
This adds a new
maxfeerateparameter tosendrawtransactionwhich forces the node to reject a transaction whose feerate is above the given fee rate.This is a safety harness from shooting yourself in the foot and accidentally overpaying fees.
See also #12911.