Skip to content

Commit a701fcf

Browse files
vasildjonatack
andcommitted
net: Do not skip the I2P network from GetNetworkNames()
So that help texts include "i2p" in: * `./bitcoind -help` (in `-onlynet` description) * `getpeerinfo` RPC * `getnetworkinfo` RPC Co-authored-by: Jon Atack <[email protected]>
1 parent 0181e24 commit a701fcf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/netbase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ std::vector<std::string> GetNetworkNames(bool append_unroutable)
7878
std::vector<std::string> names;
7979
for (int n = 0; n < NET_MAX; ++n) {
8080
const enum Network network{static_cast<Network>(n)};
81-
if (network == NET_UNROUTABLE || network == NET_I2P || network == NET_CJDNS || network == NET_INTERNAL) continue;
81+
if (network == NET_UNROUTABLE || network == NET_CJDNS || network == NET_INTERNAL) continue;
8282
names.emplace_back(GetNetworkName(network));
8383
}
8484
if (append_unroutable) {

test/functional/rpc_net.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_getpeerinfo(self):
105105
assert_equal(peer_info[1][1]['connection_type'], 'inbound')
106106

107107
# Check dynamically generated networks list in getpeerinfo help output.
108-
assert "(ipv4, ipv6, onion, not_publicly_routable)" in self.nodes[0].help("getpeerinfo")
108+
assert "(ipv4, ipv6, onion, i2p, not_publicly_routable)" in self.nodes[0].help("getpeerinfo")
109109

110110
def test_getnettotals(self):
111111
self.log.info("Test getnettotals")
@@ -156,7 +156,7 @@ def test_getnetworkinfo(self):
156156
assert_net_servicesnames(int(info["localservices"], 0x10), info["localservicesnames"])
157157

158158
# Check dynamically generated networks list in getnetworkinfo help output.
159-
assert "(ipv4, ipv6, onion)" in self.nodes[0].help("getnetworkinfo")
159+
assert "(ipv4, ipv6, onion, i2p)" in self.nodes[0].help("getnetworkinfo")
160160

161161
def test_getaddednodeinfo(self):
162162
self.log.info("Test getaddednodeinfo")

0 commit comments

Comments
 (0)