net: Enable local address discovery when bind=0.0.0.0 is used #34484

pull BuilderFred wants to merge 1 commits into bitcoin:master from BuilderFred:fix-discover-bind-any changing 1 files +19 −1
  1. BuilderFred commented at 4:03 pm on February 2, 2026: none

    Motivation

    The Discover() function in init.cpp was only being called if bind_on_any was true. However, bind_on_any is set to false if an explicit -bind argument is provided, even if that argument is -bind=0.0.0.0 (which effectively binds to all interfaces).

    This behavior prevented local address discovery when a user explicitly configured -bind=0.0.0.0, which is common in containerized environments or when users want to be explicit about interface binding.

    Fixes #31293.

    Solution

    Updated the logic in init.cpp to check if any of the provided bind addresses (either via -bind or -whitebind) are “any” addresses (0.0.0.0 or ::). If so, we enable discovery.

    Testing

    • Validated that Discover() is called when -bind=0.0.0.0 is used.
    • Verified standard behavior (no bind, specific bind) remains unchanged.
  2. net: Enable local address discovery when bind=0.0.0.0 is used 227ed708ca
  3. DrahtBot added the label P2P on Feb 2, 2026
  4. DrahtBot commented at 4:03 pm on February 2, 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.

  5. maflcko commented at 4:09 pm on February 2, 2026: member
    dupe
  6. maflcko closed this on Feb 2, 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-02-17 12:13 UTC

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