mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
net: don't skip CJDNS from GetNetworksInfo()
This commit is contained in:
parent
e9d90d3c11
commit
e6890fcb44
3 changed files with 7 additions and 3 deletions
|
@ -566,7 +566,7 @@ static UniValue GetNetworksInfo()
|
||||||
UniValue networks(UniValue::VARR);
|
UniValue networks(UniValue::VARR);
|
||||||
for (int n = 0; n < NET_MAX; ++n) {
|
for (int n = 0; n < NET_MAX; ++n) {
|
||||||
enum Network network = static_cast<enum Network>(n);
|
enum Network network = static_cast<enum Network>(n);
|
||||||
if (network == NET_UNROUTABLE || network == NET_CJDNS || network == NET_INTERNAL) continue;
|
if (network == NET_UNROUTABLE || network == NET_INTERNAL) continue;
|
||||||
proxyType proxy;
|
proxyType proxy;
|
||||||
UniValue obj(UniValue::VOBJ);
|
UniValue obj(UniValue::VOBJ);
|
||||||
GetProxy(network, proxy);
|
GetProxy(network, proxy);
|
||||||
|
|
|
@ -50,9 +50,10 @@ NET_IPV4 = "ipv4"
|
||||||
NET_IPV6 = "ipv6"
|
NET_IPV6 = "ipv6"
|
||||||
NET_ONION = "onion"
|
NET_ONION = "onion"
|
||||||
NET_I2P = "i2p"
|
NET_I2P = "i2p"
|
||||||
|
NET_CJDNS = "cjdns"
|
||||||
|
|
||||||
# Networks returned by RPC getnetworkinfo, defined in src/rpc/net.cpp::GetNetworksInfo()
|
# Networks returned by RPC getnetworkinfo, defined in src/rpc/net.cpp::GetNetworksInfo()
|
||||||
NETWORKS = frozenset({NET_IPV4, NET_IPV6, NET_ONION, NET_I2P})
|
NETWORKS = frozenset({NET_IPV4, NET_IPV6, NET_ONION, NET_I2P, NET_CJDNS})
|
||||||
|
|
||||||
|
|
||||||
class ProxyTest(BitcoinTestFramework):
|
class ProxyTest(BitcoinTestFramework):
|
||||||
|
@ -214,6 +215,7 @@ class ProxyTest(BitcoinTestFramework):
|
||||||
assert_equal(n0[net]['proxy_randomize_credentials'], expected_randomize)
|
assert_equal(n0[net]['proxy_randomize_credentials'], expected_randomize)
|
||||||
assert_equal(n0['onion']['reachable'], True)
|
assert_equal(n0['onion']['reachable'], True)
|
||||||
assert_equal(n0['i2p']['reachable'], False)
|
assert_equal(n0['i2p']['reachable'], False)
|
||||||
|
assert_equal(n0['cjdns']['reachable'], False)
|
||||||
|
|
||||||
n1 = networks_dict(self.nodes[1].getnetworkinfo())
|
n1 = networks_dict(self.nodes[1].getnetworkinfo())
|
||||||
assert_equal(NETWORKS, n1.keys())
|
assert_equal(NETWORKS, n1.keys())
|
||||||
|
@ -240,6 +242,7 @@ class ProxyTest(BitcoinTestFramework):
|
||||||
assert_equal(n2[net]['proxy_randomize_credentials'], expected_randomize)
|
assert_equal(n2[net]['proxy_randomize_credentials'], expected_randomize)
|
||||||
assert_equal(n2['onion']['reachable'], True)
|
assert_equal(n2['onion']['reachable'], True)
|
||||||
assert_equal(n2['i2p']['reachable'], False)
|
assert_equal(n2['i2p']['reachable'], False)
|
||||||
|
assert_equal(n2['cjdns']['reachable'], False)
|
||||||
|
|
||||||
if self.have_ipv6:
|
if self.have_ipv6:
|
||||||
n3 = networks_dict(self.nodes[3].getnetworkinfo())
|
n3 = networks_dict(self.nodes[3].getnetworkinfo())
|
||||||
|
@ -253,6 +256,7 @@ class ProxyTest(BitcoinTestFramework):
|
||||||
assert_equal(n3[net]['proxy_randomize_credentials'], False)
|
assert_equal(n3[net]['proxy_randomize_credentials'], False)
|
||||||
assert_equal(n3['onion']['reachable'], False)
|
assert_equal(n3['onion']['reachable'], False)
|
||||||
assert_equal(n3['i2p']['reachable'], False)
|
assert_equal(n3['i2p']['reachable'], False)
|
||||||
|
assert_equal(n3['cjdns']['reachable'], False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -136,7 +136,7 @@ class TestBitcoinCli(BitcoinTestFramework):
|
||||||
network_info = self.nodes[0].getnetworkinfo()
|
network_info = self.nodes[0].getnetworkinfo()
|
||||||
cli_get_info_string = self.nodes[0].cli('-getinfo').send_cli()
|
cli_get_info_string = self.nodes[0].cli('-getinfo').send_cli()
|
||||||
cli_get_info = cli_get_info_string_to_dict(cli_get_info_string)
|
cli_get_info = cli_get_info_string_to_dict(cli_get_info_string)
|
||||||
assert_equal(cli_get_info["Proxies"], "127.0.0.1:9050 (ipv4, ipv6, onion), 127.0.0.1:7656 (i2p)")
|
assert_equal(cli_get_info["Proxies"], "127.0.0.1:9050 (ipv4, ipv6, onion, cjdns), 127.0.0.1:7656 (i2p)")
|
||||||
|
|
||||||
if self.is_wallet_compiled():
|
if self.is_wallet_compiled():
|
||||||
self.log.info("Test -getinfo and bitcoin-cli getwalletinfo return expected wallet info")
|
self.log.info("Test -getinfo and bitcoin-cli getwalletinfo return expected wallet info")
|
||||||
|
|
Loading…
Add table
Reference in a new issue