wallet: fix only default RBF to true when unset #35677

pull polespinasa wants to merge 1 commits into bitcoin:master from polespinasa:2026-07-07-fixoptionalconditional changing 1 files +1 −1
  1. polespinasa commented at 2:43 PM on July 7, 2026: member

    In SetFeeEstimateMode(), m_signal_bip125_rbf should only be set to the default value (true) when it is unset.

    Currently, the code uses !m_signal_bip125_rbf, which evaluates to true both when the std::optional is unset and when it contains false. As a result, an explicitly set false is incorrectly overwritten with true.

    Fix this by checking has_value() instead, so only the unset case receives the default value.

    For extra context see the PR where it was detected #35433 (review)

  2. wallet: make sure false is not confused with unset 207da05fda
  3. DrahtBot added the label Wallet on Jul 7, 2026
  4. DrahtBot commented at 2:43 PM on July 7, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. polespinasa renamed this:
    wallet: only default RBF to true when unset
    wallet: fix only default RBF to true when unset
    on Jul 7, 2026
  6. maflcko commented at 2:51 PM on July 7, 2026: member

    ???

    In C++, the behavior of operator! on a std::optional does not evaluate the contained value. Instead, according to the C++ standard, !m_signal_bip125_rbf is equivalent to checking if the optional does not contain a value (!m_signal_bip125_rbf.has_value()).

    Generally, it would be good if refactor pull requests said that they are refactor, and behavior changing pull requests gave steps to test.

  7. polespinasa commented at 2:59 PM on July 7, 2026: member

    I think I just got confused for a second 😅

  8. polespinasa closed this on Jul 7, 2026

  9. polespinasa deleted the branch on Jul 7, 2026

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-07-09 06:47 UTC