Merge bitcoin/bitcoin#26988: cli: rework -addrinfo cli to use addresses which aren’t filtered for quality/recency

b3046cca71 doc: add release notes for #26988 (stratospher)
675be93024 cli: modify -addrinfo to use getaddrmaninfo RPC endpoint (stratospher)

Pull request description:

  Rework of `-addrinfo` CLI is done using `getaddrmaninfo` RPC proposed in https://github.com/bitcoin/bitcoin/pull/27511. This would be useful for users who want to know the total number of addresses the node knows about and can make connections to.

  Currently, `-addrinfo` returns total number of addresses the node knows about after filtering them for quality + recency using [`isTerrible`](4b51290f71/src/addrman.cpp (L808)). However `isTerrible`addresses [don't matter](https://github.com/bitcoin/bitcoin/pull/26988#discussion_r1147725684) when selecting outbound peers to connect to. Total number of addresses the node knows about could be higher than what `-addrinfo` currently displays. See https://github.com/bitcoin/bitcoin/pull/24370.

ACKs for top commit:
  ajtowns:
    ACK b3046cca71
  pablomartin4btc:
    re-ACK b3046cca71
  vasild:
    ACK b3046cca71
  sr-gi:
    tACK b3046cca71

Tree-SHA512: 764b74f9e0e28a65f8644a31228ca70f6e2cd4c6a93d8f29093ed7a241cd20a81e24b4babace170d945fb28078793d52ec1f4bce898a6d478950fb29ce54af91
This commit is contained in:
merge-script
2026-03-11 09:12:13 +01:00
2 changed files with 27 additions and 20 deletions

View File

@@ -0,0 +1,8 @@
Tools and Utilities
--------
- CLI -addrinfo now returns the full set of known addresses. In previous versions (v22.0 - v30.0) the set of returned
addresses was filtered for quality and recency. This was changed since it does not match the logic for selecting peers
to connect to, which does not filter. Note: CLI -addrinfo now requires bitcoind v26.0 or later, as it uses the
getaddrmaninfo RPC internally. Users querying older, unmaintained node versions would need to use an older bitcoin-cli
version. (#26988)