Skip to content

getnodeaddresses returns an empty list #320

Closed

Description

@jamillambert

It is not possible to test the return shape of getnodeaddresses with the current test setup since an empty list is returned.

Related to the issue bitcoin/bitcoin#16990

Activity

  1. tcharding commented on Aug 5, 2025

    @tcharding
    Member

    Oh when we discussed this I thought it was returning connected addresses. I have no clue where these addresses are supposed to come from, are they a Core configurable item?

  2. added a commit that references this issue on Aug 5, 2025
  3. 0xB10C commented on Aug 18, 2025

    @0xB10C
    Contributor

    getnodeaddresses lists addresses from the Bitcoin Core IP address manager tables. These are IP addresses that presumably host reachable BItcoin nodes. Nodes gossip IP addresses through the network.

    $ bitcoin-cli help getnodeaddresses
    getnodeaddresses ( count "network" )
    
    Return known addresses, after filtering for quality and recency.
    These can potentially be used to find new peers in the network.
    The total number of addresses known to the node may be higher.
    

    You can use the test-only RPC addpeeraddress to add an address to the the addrman.

    $ bitcoin-cli help addpeeraddress
    addpeeraddress "address" port ( tried )
    
    Add the address of a potential peer to an address manager table. This RPC is for testing only.
    
    Arguments:
    1. address    (string, required) The IP address of the peer
    2. port       (numeric, required) The port of the peer
    3. tried      (boolean, optional, default=false) If true, attempt to add the peer to the tried addresses table
    
    Result:
    {                            (json object)
      "success" : true|false,    (boolean) whether the peer address was successfully added to the address manager table
      "error" : "str"            (string, optional) error description, if the address could not be added
    }
    
  4. tcharding commented on Aug 19, 2025

    @tcharding
    Member

    Ah mad, nice one man!

  5. jamillambert commented on Aug 19, 2025

    @jamillambert
    CollaboratorAuthor

    Thanks for this. It was very useful.

  6. added a commit that references this issue on Aug 20, 2025
    42e808f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions