wallet: rpc: Improve error message for low feerates. #34640

pull davidgumberg wants to merge 1 commits into bitcoin:master from davidgumberg:2026-02-20-send-minfee-msg changing 2 files +24 −2
  1. davidgumberg commented at 10:38 pm on February 20, 2026: contributor

    Giving the user a hint about what action to take when they encounter an error related to a feerate that is below the minimum. I encountered this myself not knowing about -mintxfee and the manpage was slightly less than clear,

    0       -mintxfee=<amt>
    1
    2              Fee rates (in BTC/kvB) smaller than this are considered zero fee for  transaction  creation
    3              (default: 0.00001)
    
  2. wallet: rpc: Improve error message for low feerates. b77555c8fb
  3. DrahtBot added the label Wallet on Feb 20, 2026
  4. DrahtBot commented at 10:39 pm on February 20, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK rkrux, musaHaruna

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. in src/wallet/rpc/spend.cpp:1438 in b77555c8fb
    1434@@ -1435,7 +1435,18 @@ RPCHelpMan sendall()
    1435             // Do not, ever, assume that it's fine to change the fee rate if the user has explicitly
    1436             // provided one
    1437             if (coin_control.m_feerate && fee_rate > *coin_control.m_feerate) {
    1438-                throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Fee rate (%s) is lower than the minimum fee rate setting (%s)", coin_control.m_feerate->ToString(FeeRateFormat::SAT_VB), fee_rate.ToString(FeeRateFormat::SAT_VB)));
    1439+                const auto f = FeeRateFormat::SAT_VB;
    


    rkrux commented at 12:22 pm on February 25, 2026:
    Sure its usage is limited and bounded but calling it just f doesn’t help the reader much.
  6. in src/wallet/rpc/spend.cpp:1447 in b77555c8fb
    1443+                if (fee_calc_out.reason == FeeReason::REQUIRED) {
    1444+                    msg += strprintf("\nConsider modifying %s (%s) or %s (%s).",
    1445+                        "-mintxfee",
    1446+                        pwallet->m_min_fee.ToString(f),
    1447+                        "-minrelaytxfee",
    1448+                        pwallet->chain().relayMinFee().ToString(f));
    


    rkrux commented at 12:26 pm on February 25, 2026:

    I don’t see a strong reason to add placeholders for hardcoded values. The following diff for succinctness?

     0--- a/src/wallet/rpc/spend.cpp
     1+++ b/src/wallet/rpc/spend.cpp
     2@@ -1440,10 +1440,8 @@ RPCHelpMan sendall()
     3                     coin_control.m_feerate->ToString(f),
     4                     fee_rate.ToString(f))};
     5                 if (fee_calc_out.reason == FeeReason::REQUIRED) {
     6-                    msg += strprintf("\nConsider modifying %s (%s) or %s (%s).",
     7-                        "-mintxfee",
     8+                    msg += strprintf("\nConsider modifying -mintxfee (%s) or -minrelaytxfee (%s).",
     9                         pwallet->m_min_fee.ToString(f),
    10-                        "-minrelaytxfee",
    11                         pwallet->chain().relayMinFee().ToString(f));
    12                 }
    
  7. rkrux commented at 12:33 pm on February 25, 2026: contributor
    Concept ACK for the intent to add an actionable message in case of this error.
  8. musaHaruna commented at 10:11 am on February 26, 2026: contributor

    Concept ACK on improving error message for low feerates

    Sure its usage is limited and bounded but calling it just f doesn’t help the reader much.

    Also agree with this comment. I think naming the variable format or fee_rate_format makes it more readable.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-03 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me