refactor: Return std::optional from GetNameProxy/GetProxy #34741

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2603-opt-proxy changing 8 files +60 −56
  1. maflcko commented at 12:34 pm on March 5, 2026: member

    Currently the getters have a mutable reference as inout param and return a bool to indicate success. This is confusing, because the success bool is redundant with the IsValid() state on the proxy object.

    So in theory, the functions could reset the mutable proxy object to an invalid state and return void.

    However, this would also be confusing, because devs can forget to check IsValid().

    Fix all issues by using std::optional<Proxy>, where devs no longer have to check IsValid() manually, or a separate bool.

  2. refactor: Return std::optional from GetNameProxy fab60c5534
  3. refactor: Return std::optional from GetProxy fa66d1ad49
  4. DrahtBot renamed this:
    refactor: Return std::optional from GetNameProxy/GetProxy
    refactor: Return std::optional from GetNameProxy/GetProxy
    on Mar 5, 2026
  5. DrahtBot added the label Refactoring on Mar 5, 2026
  6. DrahtBot commented at 12:34 pm on March 5, 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. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34520 (refactor: Add [[nodiscard]] to functions returning bool+mutable ref by maflcko)
    • #34486 (net: Reduce local network activity when networkactive=0 by willcl-ark)
    • #32065 (i2p: make a time gap between creating transient sessions and using them by vasild)
    • #30951 (net: option to disallow v1 connection on ipv4 and ipv6 peers by stratospher)

    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.

  7. DrahtBot added the label CI failed on Mar 5, 2026
  8. DrahtBot removed the label CI failed on Mar 5, 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-03-09 09:13 UTC

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