test: wallet: Check fallbackfee default argument behavior. #34382

pull davidgumberg wants to merge 2 commits into bitcoin:master from davidgumberg:2026-01-22-fallbackfee_experiments changing 1 files +33 −3
  1. davidgumberg commented at 9:15 pm on January 22, 2026: contributor

    In an unmerged branch of #32636 (https://github.com/bitcoin/bitcoin/commit/097e00f90765915b0f8353a4eb5ebb18ceae2a66) I unintentionally broke default -fallbackfee behavior, but this was not caught by any tests. See #32636 (review).

    Something like the following diff does not cause any test failures on master despite causing a behavior change:

     0diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
     1index bc27018cd2..079610fba0 100644
     2--- a/src/wallet/wallet.cpp
     3+++ b/src/wallet/wallet.cpp
     4@@ -3048,24 +3048,24 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
     5     if (const auto arg{args.GetArg("-fallbackfee")}) {
     6         std::optional<CAmount> fallback_fee = ParseMoney(*arg);
     7         if (!fallback_fee) {
     8             error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-fallbackfee", *arg);
     9             return nullptr;
    10         } else if (fallback_fee.value() > HIGH_TX_FEE_PER_KB) {
    11             warnings.push_back(AmountHighWarn("-fallbackfee") + Untranslated(" ") +
    12                                _("This is the transaction fee you may pay when fee estimates are not available."));
    13         }
    14         walletInstance->m_fallback_fee = CFeeRate{fallback_fee.value()};
    15+        // Disable fallback fee in case value was set to 0, enable if non-null value
    16+        walletInstance->m_allow_fallback_fee = walletInstance->m_fallback_fee.GetFeePerK() != 0;
    17     }
    18
    19-    // Disable fallback fee in case value was set to 0, enable if non-null value
    20-    walletInstance->m_allow_fallback_fee = walletInstance->m_fallback_fee.GetFeePerK() != 0;
    

    This PR adds a functional test check that when no -fallbackfee argument is set and fee estimation is not possible, that sending fails because -fallbackfee is disabled by default.

  2. DrahtBot added the label Tests on Jan 22, 2026
  3. DrahtBot commented at 9:15 pm on January 22, 2026: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34382.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK w0xlt

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

  4. test: wallet: -fallbackfee default is 0 699e2b4dde
  5. test: wallet: Warning for excessive fallback fee. 28a64d4ef8
  6. davidgumberg force-pushed on Jan 22, 2026
  7. DrahtBot added the label CI failed on Jan 22, 2026
  8. furszy commented at 9:23 pm on January 22, 2026: member
    not related, but the fee arg changes remind me to #29278. Writing it so we don’t forget it.
  9. DrahtBot removed the label CI failed on Jan 22, 2026
  10. w0xlt commented at 10:48 pm on January 22, 2026: contributor

    ACK 28a64d4ef8b872e3687350f93fd3dd78717f795f

    nit: This snippet could go in the second commit instead.

    0        # Sending a transaction with a fallback fee set succeeds. Use the
    1        # largest fallbackfee value that doesn't trigger a warning.
    2        self.restart_node(0, extra_args=[f"-fallbackfee={HIGH_TX_FEE_PER_KB}"])
    3        self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
    4        self.nodes[0].fundrawtransaction(self.nodes[0].createrawtransaction([], {self.nodes[0].getnewaddress(): 1}))
    5        self.nodes[0].sendmany("", {self.nodes[0].getnewaddress(): 1})
    
  11. davidgumberg commented at 1:59 am on January 23, 2026: contributor

    nit: This snippet could go in the second commit instead.

    This replaces the default sendtoaddress test which gets deleted in the first commit, so to be atomic I think it should probably stay in the first commit.


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-01-27 06:13 UTC

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