bitcoin-cli -netinfo ignores inbound peer from local network #26579

issue pinheadmz openend this issue on November 26, 2022
  1. pinheadmz commented at 1:32 am on November 26, 2022: member

    I have bitcoind serving cfilters to an LND node on my local network on separate machines. Both have 192.168.1.x IP addresses and they connect fine using neutrino. However, the LND node does not appear in the bitcoin-cli -netinfo table.

    The reason is because if you look at the getpeerinfo response:

     0{
     1  "id": 11728,
     2  "addr": "192.168.1.153:64367",
     3  "addrbind": "192.168.1.13:8333",
     4  "addrlocal": "192.168.1.13:8333",
     5  "network": "not_publicly_routable",
     6  "services": "0000000000000048",
     7  "servicesnames": [
     8    "WITNESS",
     9    "COMPACT_FILTERS"
    10  ],
    11...
    

    …so bitcoin-cli ignores the peer here:

    https://github.com/bitcoin/bitcoin/blob/9c47eb450346937b3d7ee21b9e669b5c91a7ed6c/src/bitcoin-cli.cpp#L477-L479

    …expecting one of these strings only:

    https://github.com/bitcoin/bitcoin/blob/9c47eb450346937b3d7ee21b9e669b5c91a7ed6c/src/bitcoin-cli.cpp#L58

    I’m happy to fix / add this myself unless there’s a reason? Maybe instead of skipping the peer we can just add an “unknown network” category, or “other” …?

    cc: @jonatack

  2. pinheadmz added the label Bug on Nov 26, 2022
  3. maflcko closed this on Feb 15, 2023

  4. sidhujag referenced this in commit 9789149df4 on Feb 15, 2023
  5. bitcoin locked this on Feb 15, 2024


pinheadmz

Labels
Bug


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: 2024-12-04 18:12 UTC

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