Refactor: Updated TransactionError to use util::Expected and removed TransactionError:OK #35105

pull kevkevinpal wants to merge 2 commits into bitcoin:master from kevkevinpal:TransactionErrorToTransactionResponse changing 8 files +44 −46
  1. kevkevinpal commented at 2:18 PM on April 18, 2026: contributor

    Summary

    Similar to #32958 and motivated by #32958#pullrequestreview-3107029707

    We now are using util::Expected and removed TransactionError::OK

    This makes the enum less confusing because it no longer includes OK.

  2. DrahtBot added the label Refactoring on Apr 18, 2026
  3. DrahtBot commented at 2:18 PM on April 18, 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/35105.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Approach NACK janb84

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35511 (RFC: consensus: Make CAmount a class by hodlinator)
    • #29278 (Wallet: Add maxfeerate wallet startup option by ismaelsadeeq)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. janb84 commented at 9:25 AM on April 20, 2026: contributor

    Approach NACK

    I do not think this is the best future proof way to accomplish the goal. In C++ 23 std::expected is introduced, which is a better way (imo) to do for explicit error handling. E.g link link2

    Yes we are currently on C++ 20 but a "polyfill" std::expected is already introduced in the code as util::Expected<T, E>

    This makes the upgrade path to C++23 an easy search and replace and is a better way to do explicit error handling / remove the ok from the errors.

  5. kevkevinpal force-pushed on Apr 28, 2026
  6. kevkevinpal commented at 12:12 PM on April 28, 2026: contributor

    @janb84 thanks for the review!

    I agree and I pushed 592a833 to instead use util::Expected.

    Feel free to give this another look and let me know if it seems fine to you

  7. kevkevinpal renamed this:
    Refactor: Updated TransactionError to TransactionResponse
    Refactor: Updated TransactionError to use util::Expected and removed TransactionError:OK
    on Apr 28, 2026
  8. DrahtBot added the label Needs rebase on May 22, 2026
  9. kevkevinpal force-pushed on Jun 2, 2026
  10. kevkevinpal commented at 3:13 AM on June 2, 2026: contributor

    rebased and fixed conflicts to 1bcea55

  11. DrahtBot added the label CI failed on Jun 2, 2026
  12. DrahtBot commented at 4:36 AM on June 2, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/26795995122/job/78992358839</sub> <sub>LLM reason (✨ experimental): CI failed because IWYU detected missing headers and intentionally failed after modifying src/node/interfaces.cpp (added #include <util/expected.h>).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  13. DrahtBot removed the label Needs rebase on Jun 2, 2026
  14. DrahtBot commented at 3:10 PM on June 10, 2026: contributor

    Maybe turn into draft while CI is red?

  15. refactor: BroadcastTransaction and HandleATMPError now uses util::Expected 9ed40f52c7
  16. refactor: remove unused TransactionError:OK 78a2b0dd6e
  17. kevkevinpal force-pushed on Jun 12, 2026
  18. DrahtBot commented at 8:36 AM on June 15, 2026: contributor

    Maybe turn into draft while CI is red?

  19. DrahtBot marked this as a draft on Jun 19, 2026
  20. DrahtBot commented at 8:46 AM on June 19, 2026: contributor

    Converted to draft, due to failing CI


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-06-21 21:51 UTC

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