Skip to content

Discover() will not run if listening on any address with an explicit bind=0.0.0.0 #31293

Open
@vasild

Description

Current behaviour

bitcoin/src/init.cpp

Lines 1890 to 1892 in 85bcfee

// If the user did not specify -bind= or -whitebind= then we bind
// on any address - 0.0.0.0 (IPv4) and :: (IPv6).
connOptions.bind_on_any = args.GetArgs("-bind").empty() && args.GetArgs("-whitebind").empty();

Discover() will run only if we are listening on all addresses (bind_on_any is true). However if -bind=0.0.0.0:port is explicitly given, then bind_on_any will end up being false and thus Discover() will not run when it should.

Expected behaviour

Discover own addresses even if -bind=0.0.0.0:port is given.

Steps to reproduce

Use -bind=0.0.0.0:port.

How did you obtain Bitcoin Core

Compiled from source

What version of Bitcoin Core are you using?

master@85bcfeea23568053ea09013fb8263fa1511d7123

Operating system and version

Windows 3.11

Background

See #31133 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions