Skip to content

Commit 30b0fcf

Browse files
committed
merge bitcoin#22544: drop torv2; torv3 becomes onion per GetNetworkName()
1 parent b6ca36e commit 30b0fcf

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

doc/release-notes-22544.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Tools and Utilities
2+
-------------------
3+
4+
- CLI `-addrinfo` now returns a single field for the number of `onion` addresses
5+
known to the node instead of separate `torv2` and `torv3` fields, as support
6+
for Tor V2 addresses was removed from Dash Core in 18.0.

doc/tor.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ There are several ways to see your local onion address in Dash Core:
1818
You may set the `-debug=tor` config logging option to have additional
1919
information in the debug log about your Tor configuration.
2020

21-
CLI `-addrinfo` returns the number of addresses known to your node per network
22-
type, including Tor v2 and v3. This is useful to see how many onion addresses
23-
are known to your node for `-onlynet=onion` and how many Tor v3 addresses it
24-
knows when upgrading to current and future Tor releases that support Tor v3 only.
21+
CLI `-addrinfo` returns the number of addresses known to your node per
22+
network. This can be useful to see how many onion peers your node knows,
23+
e.g. for `-onlynet=onion`.
2524

2625
## 1. Run Dash Core behind a Tor proxy
2726

src/bitcoin-cli.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class BaseRequestHandler
259259
class AddrinfoRequestHandler : public BaseRequestHandler
260260
{
261261
private:
262-
static constexpr std::array m_networks{"ipv4", "ipv6", "torv2", "torv3", "i2p"};
262+
static constexpr std::array m_networks{"ipv4", "ipv6", "onion", "i2p"};
263263
int8_t NetworkStringToId(const std::string& str) const
264264
{
265265
for (size_t i = 0; i < m_networks.size(); ++i) {
@@ -285,13 +285,10 @@ class AddrinfoRequestHandler : public BaseRequestHandler
285285
if (!nodes.empty() && nodes.at(0)["network"].isNull()) {
286286
throw std::runtime_error("-addrinfo requires dashd server to be running v21.0 and up");
287287
}
288-
// Count the number of peers we know by network, including torv2 versus torv3.
288+
// Count the number of peers known to our node, by network.
289289
std::array<uint64_t, m_networks.size()> counts{{}};
290290
for (const UniValue& node : nodes) {
291291
std::string network_name{node["network"].get_str()};
292-
if (network_name == "onion") {
293-
network_name = node["address"].get_str().size() > 22 ? "torv3" : "torv2";
294-
}
295292
const int8_t network_id{NetworkStringToId(network_name)};
296293
if (network_id == UNKNOWN_NETWORK) continue;
297294
++counts.at(network_id);

0 commit comments

Comments
 (0)