From 75ea9ecf11bfeb120c58dc6c62539021a94ef97c Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 25 Jul 2021 12:55:01 +0200 Subject: cli -addrinfo: drop torv2, torv3 becomes onion per GetNetworkName() --- src/bitcoin-cli.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 1ec6411e32..f72804d29c 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -245,7 +245,7 @@ public: class AddrinfoRequestHandler : public BaseRequestHandler { private: - static constexpr std::array m_networks{"ipv4", "ipv6", "torv2", "torv3", "i2p"}; + static constexpr std::array m_networks{"ipv4", "ipv6", "onion", "i2p"}; int8_t NetworkStringToId(const std::string& str) const { for (size_t i = 0; i < m_networks.size(); ++i) { @@ -271,13 +271,10 @@ public: if (!nodes.empty() && nodes.at(0)["network"].isNull()) { throw std::runtime_error("-addrinfo requires bitcoind server to be running v22.0 and up"); } - // Count the number of peers we know by network, including torv2 versus torv3. + // Count the number of peers known to our node, by network. std::array counts{{}}; for (const UniValue& node : nodes) { std::string network_name{node["network"].get_str()}; - if (network_name == "onion") { - network_name = node["address"].get_str().size() > 22 ? "torv3" : "torv2"; - } const int8_t network_id{NetworkStringToId(network_name)}; if (network_id == UNKNOWN_NETWORK) continue; ++counts.at(network_id); -- cgit v1.2.3 From 49d503aefa74f11e5d93432987fa3775ed82c979 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Fri, 30 Jul 2021 09:41:39 +0200 Subject: doc: update -addrinfo in release-notes.md and tor.md --- doc/release-notes.md | 4 ++++ doc/tor.md | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index cf9edd9b08..81e6f36dbf 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -77,6 +77,10 @@ Tools and Utilities - Update `-getinfo` to return data in a user-friendly format that also reduces vertical space. (#21832) +- CLI `-addrinfo` now returns a single field for the number of `onion` addresses + known to the node instead of separate `torv2` and `torv3` fields, as support + for Tor V2 addresses was removed from Bitcoin Core in 22.0. (#22544) + Wallet ------ diff --git a/doc/tor.md b/doc/tor.md index 7d134b64e0..a1a64bfe6f 100644 --- a/doc/tor.md +++ b/doc/tor.md @@ -23,10 +23,9 @@ There are several ways to see your local onion address in Bitcoin Core: You may set the `-debug=tor` config logging option to have additional information in the debug log about your Tor configuration. -CLI `-addrinfo` returns the number of addresses known to your node per network -type, including Tor v2 and v3. This is useful to see how many onion addresses -are known to your node for `-onlynet=onion` and how many Tor v3 addresses it -knows when upgrading to Bitcoin Core v22.0 and up that supports Tor v3 only. +CLI `-addrinfo` returns the number of addresses known to your node per +network. This can be useful to see how many onion peers your node knows, +e.g. for `-onlynet=onion`. ## 1. Run Bitcoin Core behind a Tor proxy -- cgit v1.2.3