aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-04-07 18:55:11 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-04-07 18:56:01 +0200
commitcb79cabdd9d9a6d183cf09575dd46925f2c9cb3b (patch)
tree05a8040a3f7856b41cf48cd3cd03547172e2244b /doc
parentaa69471ecd553dbcd7dd6d1b2e59dfb69d6a0cf3 (diff)
parent5c446784b10b168a6f649469a6627ac231eb1de2 (diff)
downloadbitcoin-cb79cabdd9d9a6d183cf09575dd46925f2c9cb3b.tar.xz
Merge #21594: rpc: add network field to getnodeaddresses
5c446784b10b168a6f649469a6627ac231eb1de2 rpc: improve getnodeaddresses help (Jon Atack) 1b9189866af26ed0003c1afe8dd5652ebe9b2e4a rpc: simplify/constify getnodeaddresses code (Jon Atack) 3bb6e7b6555f3c8743a697cb9d509620714dc483 rpc: add network field to rpc getnodeaddresses (Jon Atack) Pull request description: This patch adds a network field to RPC `getnodeaddresses`, which is useful on its own, particularly with the addition of new networks like I2P and others in the future, and which I also found helpful for adding a new CLI command as a follow-up to this pull that calls `getnodeaddresses` and needs to know the network of each address. While here, also improve the `getnodeaddresses` code and help. ``` $ bitcoin-cli -signet getnodeaddresses 3 [ { "time": 1611564659, "services": 1033, "address": "2600:1702:3c30:734f:8f2e:744b:2a51:dfa5", "port": 38333, "network": "ipv6" }, { "time": 1617531931, "services": 1033, "address": "153.126.143.201", "port": 38333, "network": "ipv4" }, { "time": 1617473058, "services": 1033, "address": "nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion", "port": 38333, "network": "onion" } ] $ bitcoin-cli help getnodeaddresses getnodeaddresses ( count ) Return known addresses, which can potentially be used to find new nodes in the network. Arguments: 1. count (numeric, optional, default=1) The maximum number of addresses to return. Specify 0 to return all known addresses. Result: [ (json array) { (json object) "time" : xxx, (numeric) The UNIX epoch time when the node was last seen "services" : n, (numeric) The services offered by the node "address" : "str", (string) The address of the node "port" : n, (numeric) The port number of the node "network" : "str" (string) The network (ipv4, ipv6, onion, i2p) the node connected through }, ... ] ``` Future idea: allow passing `getnodeaddresses` a network (or networks) as an argument to return only addresses in that network. ACKs for top commit: laanwj: Tested ACK 5c446784b10b168a6f649469a6627ac231eb1de2 jarolrod: re-ACK 5c446784b10b168a6f649469a6627ac231eb1de2 promag: Code review ACK 5c446784b10b168a6f649469a6627ac231eb1de2. Tree-SHA512: ab0101f50c76d98c3204133b9f2ab6b7b17193ada31455ef706ad11afbf48f472fa3deb33e96028682369b35710ccd07d81863d2fd55c1485f32432f2b75efa8
Diffstat (limited to 'doc')
-rw-r--r--doc/release-notes.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/release-notes.md b/doc/release-notes.md
index 334dfa80a4..4ef94cf754 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -126,6 +126,9 @@ Changes to Wallet or GUI related settings can be found in the GUI or Wallet sect
- Passing an invalid `-rpcauth` argument now cause bitcoind to fail to start. (#20461)
+- The `getnodeaddresses` RPC now returns a "network" field indicating the
+ network type (ipv4, ipv6, onion, or i2p) for each address. (#21594)
+
Tools and Utilities
-------------------