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

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  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-05-02 12:12 UTC

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