Inconsistent CJDNS address handling in Local addresses and AddLocal logs #33471

issue w0xlt opened this issue on September 23, 2025
  1. w0xlt commented at 11:22 PM on September 23, 2025: contributor

    When running:

    ./build/bin/bitcoind -daemon -server=1 -onion=127.0.0.1:9050 -externalip=<hostname_addr> -listen -cjdnsreachable
    

    only two Tor addresses appear under Local addresses and no CJDNS addresses in bitcoin-cli -netinfo 4. The log also shows two AddLocal(...) entries for the onion address, but none for the CJDNS address. However, adding a CJDNS peer via addnode ... add works as expected.

    In contrast, running:

    ./build/bin/bitcoind -daemon -listen -cjdnsreachable
    

    shows one Tor address and one CJDNS address in Local addresses. The log also includes one AddLocal(...) for the onion address and one for the CJDNS address, and peer addition works normally.

    This seems inconsistent: in the first case, shouldn’t the CJDNS address also appear in Local addresses and be logged with AddLocal(<cjdns_addr>)?

  2. willcl-ark added the label Bug on Sep 25, 2025
  3. willcl-ark added the label Utils/log/libs on Sep 25, 2025
  4. bitcoin deleted a comment on Sep 30, 2025
  5. big14way commented at 8:29 AM on November 8, 2025: none

    @willcl-ark please assign me this issue i can fix this bug

  6. willcl-ark commented at 11:30 AM on November 10, 2025: member

    @big14way you don't need to be assigned an issue to work on it in this project. Opening a pull request (please read CONTRIBUTING.md frist) and linking it to this issue in the PR description is all that's needed.

  7. big14way commented at 9:49 AM on November 11, 2025: none

    @willcl-ark thank you for clarifyingi will look through the CONTRIBUTING.md frist i appreciate it

  8. ANAVHEOBA referenced this in commit af5c2fcf14 on Dec 19, 2025
  9. pejfat08-rgb commented at 4:21 PM on December 28, 2025: none

    جحخ

  10. vasild commented at 1:30 PM on June 18, 2026: contributor

    I tested this locally and, unless I am missing something, I do not think that there is a bug here. Adding -externalip disables -discover as it should and as documented:

    https://github.com/bitcoin/bitcoin/blob/341360964a6fef725825639edc507c275f8ad0b2/src/init.cpp#L573

    That means bitcoin-cli getnetworkinfo |jq .localaddresses will not display any CJDNS or IPv4 or IPv6 address that is auto discovered by looking up at the local interfaces. Without -externalip=:

    [
      {
        "address": "1.2.3.4",
        "port": 8333,
        "score": 1
      },
      {
        "address": "fc00:1::1",
        "port": 8333,
        "score": 1
      }
    ]
    

    (I have 1.2.3.4 and fc00:1::1 configured on local interfaces)

    With -externalip=5.6.7.8

    [
      {
        "address": "5.6.7.8",
        "port": 8333,
        "score": 4
      }
    ]
    

    ... only two Tor addresses appear under Local addresses ...

    Why two? I would expect one Tor address.


    A proper configuration is, if -externalip= is to be used, then to use it for all listening addresses explicitly instead of using it for some and relying on others to be auto discovered.

  11. w0xlt commented at 9:22 PM on June 18, 2026: contributor

    Thanks for looking into this.

    I understand that -externalip currently disables -discover, so the current behavior is consistent with that rule.

    However, I would not expect specifying an IPv4/IPv6 address via -externalip= to also suppress CJDNS address discovery/advertisement, since CJDNS is a separate network and a clearnet -externalip is not useful to CJDNS peers.

    I couldn't find this interaction documented explicitly.

    If this behavior should be kept, maybe we should at least log a clearer message when -externalip suppresses CJDNS discovery too.

  12. vasild commented at 9:17 AM on June 22, 2026: contributor

    However, I would not expect specifying an IPv4/IPv6 address via -externalip= to also suppress CJDNS address discovery/advertisement ...

    Well, that is the same as if -externalip=some.ip.v.4 is used - that would suppress IPv6 address discovery.


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-07-04 00:51 UTC

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