Skip to content

Commit e21b824

Browse files
committed
Merge #20109: Release notes and followups from 19339
88197b0 [doc] release notes for max fee checking (gzhao408) c201d73 style and nits for fee-checking in BroadcastTransaction (gzhao408) Pull request description: Pretty trivial... addresses some tiny comments from #19339. Also fixes a docs typo from #19940 and adds a release note about the error message change for testmempoolaccept. ACKs for top commit: achow101: ACK 88197b0 MarcoFalke: cr re-ACK 88197b0 Tree-SHA512: fff16d731426b9b4db5222df02633983402f4c7241551eec98bb1554145dbdc132f40ed8ca4abd5edcebe1f4d1e879fb6d11bd91730604f6552c10cdf65706a1
2 parents ec0453c + 88197b0 commit e21b824

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

doc/release-notes.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ will trigger BIP 125 (replace-by-fee) opt-in. (#11413)
138138
option `-deprecatedrpc=banscore` is used. The `banscore` field will be fully
139139
removed in the next major release. (#19469)
140140

141-
- The `testmempoolaccept` RPC returns `vsize` and a `fee` object with the `base` fee
142-
if the transaction passes validation. (#19940)
141+
- The `testmempoolaccept` RPC returns `vsize` and a `fees` object with the `base` fee
142+
if the transaction would pass validation. (#19940)
143143

144144
- The `getpeerinfo` RPC now returns a `connection_type` field. This indicates
145145
the type of connection established with the peer. It will return one of six
@@ -448,6 +448,16 @@ RPC
448448
- Fee estimation failed
449449
- Transaction has too long of a mempool chain
450450

451+
- The `sendrawtransaction` error code for exceeding `maxfeerate` has been changed from
452+
`-26` to `-25`. The error string has been changed from "absurdly-high-fee" to
453+
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)." The
454+
`testmempoolaccept` RPC returns `max-fee-exceeded` rather than `absurdly-high-fee`
455+
as the `reject-reason`. (#19339)
456+
457+
- To make wallet and rawtransaction RPCs more consistent, the error message for
458+
exceeding maximum feerate has been changed to "Fee exceeds maximum configured by user
459+
(e.g. -maxtxfee, maxfeerate)." (#19339)
460+
451461
Tests
452462
-----
453463

src/node/transaction.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
#include <future>
1515

16-
static TransactionError HandleATMPError(const TxValidationState& state, std::string& err_string_out) {
16+
static TransactionError HandleATMPError(const TxValidationState& state, std::string& err_string_out)
17+
{
1718
err_string_out = state.ToString();
1819
if (state.IsInvalid()) {
1920
if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
@@ -50,10 +51,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
5051
if (!node.mempool->exists(hashTx)) {
5152
// Transaction is not already in the mempool.
5253
TxValidationState state;
53-
CAmount fee{0};
54-
if (max_tx_fee) {
54+
if (max_tx_fee > 0) {
5555
// First, call ATMP with test_accept and check the fee. If ATMP
5656
// fails here, return error immediately.
57+
CAmount fee{0};
5758
if (!AcceptToMemoryPool(*node.mempool, state, tx,
5859
nullptr /* plTxnReplaced */, false /* bypass_limits */, /* test_accept */ true, &fee)) {
5960
return HandleATMPError(state, err_string);

0 commit comments

Comments
 (0)