merge bitcoin#20002: expose peer network in getpeerinfo; simplify/improve -netinfo

This commit is contained in:
Kittywhiskers Van Gogh 2023-04-16 05:18:06 +00:00
parent 742d3a195d
commit f4eaad0bb9
5 changed files with 97 additions and 106 deletions

View File

@ -39,8 +39,6 @@ static const char DEFAULT_RPCCONNECT[] = "127.0.0.1";
static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900; static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900;
static const bool DEFAULT_NAMED=false; static const bool DEFAULT_NAMED=false;
static const int CONTINUE_EXECUTION=-1; static const int CONTINUE_EXECUTION=-1;
static const std::string ONION{".onion"};
static const size_t ONION_LEN{ONION.size()};
/** Default number of blocks to generate for RPC generatetoaddress. */ /** Default number of blocks to generate for RPC generatetoaddress. */
static const std::string DEFAULT_NBLOCKS = "1"; static const std::string DEFAULT_NBLOCKS = "1";
@ -306,30 +304,24 @@ public:
class NetinfoRequestHandler : public BaseRequestHandler class NetinfoRequestHandler : public BaseRequestHandler
{ {
private: private:
bool IsAddrIPv6(const std::string& addr) const static constexpr int8_t UNKNOWN_NETWORK{-1};
static constexpr size_t m_networks_size{3};
const std::array<std::string, m_networks_size> m_networks{{"ipv4", "ipv6", "onion"}};
std::array<std::array<uint16_t, m_networks_size + 2>, 3> m_counts{{{}}}; //!< Peer counts by (in/out/total, networks/total/block-relay)
int8_t NetworkStringToId(const std::string& str) const
{ {
return !addr.empty() && addr.front() == '['; for (size_t i = 0; i < m_networks_size; ++i) {
} if (str == m_networks.at(i)) return i;
bool IsInboundOnion(const std::string& addr_local, int mapped_as) const }
{ return UNKNOWN_NETWORK;
return mapped_as == 0 && addr_local.find(ONION) != std::string::npos;
}
bool IsOutboundOnion(const std::string& addr, int mapped_as) const
{
const size_t addr_len{addr.size()};
const size_t onion_pos{addr.rfind(ONION)};
return mapped_as == 0 && onion_pos != std::string::npos && addr_len > ONION_LEN &&
(onion_pos == addr_len - ONION_LEN || onion_pos == addr.find_last_of(":") - ONION_LEN);
} }
uint8_t m_details_level{0}; //!< Optional user-supplied arg to set dashboard details level uint8_t m_details_level{0}; //!< Optional user-supplied arg to set dashboard details level
bool DetailsRequested() const { return m_details_level > 0 && m_details_level < 5; } bool DetailsRequested() const { return m_details_level > 0 && m_details_level < 5; }
bool IsAddressSelected() const { return m_details_level == 2 || m_details_level == 4; } bool IsAddressSelected() const { return m_details_level == 2 || m_details_level == 4; }
bool IsVersionSelected() const { return m_details_level == 3 || m_details_level == 4; } bool IsVersionSelected() const { return m_details_level == 3 || m_details_level == 4; }
enum struct NetType { bool m_is_asmap_on{false};
ipv4, size_t m_max_addr_length{0};
ipv6, size_t m_max_id_length{2};
onion,
};
struct Peer { struct Peer {
int id; int id;
int mapped_as; int mapped_as;
@ -342,30 +334,24 @@ private:
double min_ping; double min_ping;
double ping; double ping;
std::string addr; std::string addr;
std::string network;
std::string sub_version; std::string sub_version;
NetType net_type;
bool is_block_relay; bool is_block_relay;
bool is_outbound; bool is_outbound;
bool operator<(const Peer& rhs) const { return std::tie(is_outbound, min_ping) < std::tie(rhs.is_outbound, rhs.min_ping); } bool operator<(const Peer& rhs) const { return std::tie(is_outbound, min_ping) < std::tie(rhs.is_outbound, rhs.min_ping); }
}; };
std::string NetTypeEnumToString(NetType t) std::vector<Peer> m_peers;
{
switch (t) {
case NetType::ipv4: return "ipv4";
case NetType::ipv6: return "ipv6";
case NetType::onion: return "onion";
} // no default case, so the compiler can warn about missing cases
assert(false);
}
std::string ChainToString() const std::string ChainToString() const
{ {
if (gArgs.GetChainName() == CBaseChainParams::TESTNET) return " testnet"; if (gArgs.GetChainName() == CBaseChainParams::TESTNET) return " testnet";
if (gArgs.GetChainName() == CBaseChainParams::REGTEST) return " regtest"; if (gArgs.GetChainName() == CBaseChainParams::REGTEST) return " regtest";
return ""; return "";
} }
const int64_t m_time_now{GetSystemTimeInSeconds()};
public: public:
const int ID_PEERINFO = 0; static constexpr int ID_PEERINFO = 0;
const int ID_NETWORKINFO = 1; static constexpr int ID_NETWORKINFO = 1;
UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override
{ {
@ -393,49 +379,25 @@ public:
} }
// Count peer connection totals, and if DetailsRequested(), store peer data in a vector of structs. // Count peer connection totals, and if DetailsRequested(), store peer data in a vector of structs.
const int64_t time_now{GetSystemTimeInSeconds()}; for (const UniValue& peer : batch[ID_PEERINFO]["result"].getValues()) {
int ipv4_i{0}, ipv6_i{0}, onion_i{0}, block_relay_i{0}, total_i{0}; // inbound conn counters const std::string network{peer["network"].get_str()};
int ipv4_o{0}, ipv6_o{0}, onion_o{0}, block_relay_o{0}, total_o{0}; // outbound conn counters const int8_t network_id{NetworkStringToId(network)};
size_t max_peer_id_length{2}, max_addr_length{0}; if (network_id == UNKNOWN_NETWORK) continue;
bool is_asmap_on{false}; const bool is_outbound{!peer["inbound"].get_bool()};
std::vector<Peer> peers;
const UniValue& getpeerinfo{batch[ID_PEERINFO]["result"]};
for (const UniValue& peer : getpeerinfo.getValues()) {
const std::string addr{peer["addr"].get_str()};
const std::string addr_local{peer["addrlocal"].isNull() ? "" : peer["addrlocal"].get_str()};
const int mapped_as{peer["mapped_as"].isNull() ? 0 : peer["mapped_as"].get_int()};
const bool is_block_relay{!peer["relaytxes"].get_bool()}; const bool is_block_relay{!peer["relaytxes"].get_bool()};
const bool is_inbound{peer["inbound"].get_bool()}; ++m_counts.at(is_outbound).at(network_id); // in/out by network
NetType net_type{NetType::ipv4}; ++m_counts.at(is_outbound).at(m_networks_size); // in/out overall
if (is_inbound) { ++m_counts.at(2).at(network_id); // total by network
if (IsAddrIPv6(addr)) { ++m_counts.at(2).at(m_networks_size); // total overall
net_type = NetType::ipv6; if (is_block_relay) {
++ipv6_i; ++m_counts.at(is_outbound).at(m_networks_size + 1); // in/out block-relay
} else if (IsInboundOnion(addr_local, mapped_as)) { ++m_counts.at(2).at(m_networks_size + 1); // total block-relay
net_type = NetType::onion;
++onion_i;
} else {
++ipv4_i;
}
if (is_block_relay) ++block_relay_i;
} else {
if (IsAddrIPv6(addr)) {
net_type = NetType::ipv6;
++ipv6_o;
} else if (IsOutboundOnion(addr, mapped_as)) {
net_type = NetType::onion;
++onion_o;
} else {
++ipv4_o;
}
if (is_block_relay) ++block_relay_o;
} }
if (DetailsRequested()) { if (DetailsRequested()) {
// Push data for this peer to the peers vector. // Push data for this peer to the peers vector.
const int peer_id{peer["id"].get_int()}; const int peer_id{peer["id"].get_int()};
const int mapped_as{peer["mapped_as"].isNull() ? 0 : peer["mapped_as"].get_int()};
const int version{peer["version"].get_int()}; const int version{peer["version"].get_int()};
const std::string sub_version{peer["subver"].get_str()};
const int64_t conn_time{peer["conntime"].get_int64()}; const int64_t conn_time{peer["conntime"].get_int64()};
const int64_t last_blck{peer["last_block"].get_int64()}; const int64_t last_blck{peer["last_block"].get_int64()};
const int64_t last_recv{peer["lastrecv"].get_int64()}; const int64_t last_recv{peer["lastrecv"].get_int64()};
@ -443,10 +405,12 @@ public:
const int64_t last_trxn{peer["last_transaction"].get_int64()}; const int64_t last_trxn{peer["last_transaction"].get_int64()};
const double min_ping{peer["minping"].isNull() ? -1 : peer["minping"].get_real()}; const double min_ping{peer["minping"].isNull() ? -1 : peer["minping"].get_real()};
const double ping{peer["pingtime"].isNull() ? -1 : peer["pingtime"].get_real()}; const double ping{peer["pingtime"].isNull() ? -1 : peer["pingtime"].get_real()};
peers.push_back({peer_id, mapped_as, version, conn_time, last_blck, last_recv, last_send, last_trxn, min_ping, ping, addr, sub_version, net_type, is_block_relay, !is_inbound}); const std::string addr{peer["addr"].get_str()};
max_peer_id_length = std::max(ToString(peer_id).length(), max_peer_id_length); const std::string sub_version{peer["subver"].get_str()};
max_addr_length = std::max(addr.length() + 1, max_addr_length); m_peers.push_back({peer_id, mapped_as, version, conn_time, last_blck, last_recv, last_send, last_trxn, min_ping, ping, addr, network, sub_version, is_block_relay, is_outbound});
is_asmap_on |= (mapped_as != 0); m_max_id_length = std::max(ToString(peer_id).length(), m_max_id_length);
m_max_addr_length = std::max(addr.length() + 1, m_max_addr_length);
m_is_asmap_on |= (mapped_as != 0);
} }
} }
@ -454,30 +418,30 @@ public:
std::string result{strprintf("%s %s%s - %i%s\n\n", PACKAGE_NAME, FormatFullVersion(), ChainToString(), networkinfo["protocolversion"].get_int(), networkinfo["subversion"].get_str())}; std::string result{strprintf("%s %s%s - %i%s\n\n", PACKAGE_NAME, FormatFullVersion(), ChainToString(), networkinfo["protocolversion"].get_int(), networkinfo["subversion"].get_str())};
// Report detailed peer connections list sorted by direction and minimum ping time. // Report detailed peer connections list sorted by direction and minimum ping time.
if (DetailsRequested() && !peers.empty()) { if (DetailsRequested() && !m_peers.empty()) {
std::sort(peers.begin(), peers.end()); std::sort(m_peers.begin(), m_peers.end());
result += "Peer connections sorted by direction and min ping\n<-> relay net mping ping send recv txn blk uptime "; result += "Peer connections sorted by direction and min ping\n<-> relay net mping ping send recv txn blk uptime ";
if (is_asmap_on) result += " asmap "; if (m_is_asmap_on) result += " asmap ";
result += strprintf("%*s %-*s%s\n", max_peer_id_length, "id", IsAddressSelected() ? max_addr_length : 0, IsAddressSelected() ? "address" : "", IsVersionSelected() ? "version" : ""); result += strprintf("%*s %-*s%s\n", m_max_id_length, "id", IsAddressSelected() ? m_max_addr_length : 0, IsAddressSelected() ? "address" : "", IsVersionSelected() ? "version" : "");
for (const Peer& peer : peers) { for (const Peer& peer : m_peers) {
std::string version{ToString(peer.version) + peer.sub_version}; std::string version{ToString(peer.version) + peer.sub_version};
result += strprintf( result += strprintf(
"%3s %5s %5s%6s%7s%5s%5s%5s%5s%7s%*i %*s %-*s%s\n", "%3s %5s %5s%6s%7s%5s%5s%5s%5s%7s%*i %*s %-*s%s\n",
peer.is_outbound ? "out" : "in", peer.is_outbound ? "out" : "in",
peer.is_block_relay ? "block" : "full", peer.is_block_relay ? "block" : "full",
NetTypeEnumToString(peer.net_type), peer.network,
peer.min_ping == -1 ? "" : ToString(round(1000 * peer.min_ping)), peer.min_ping == -1 ? "" : ToString(round(1000 * peer.min_ping)),
peer.ping == -1 ? "" : ToString(round(1000 * peer.ping)), peer.ping == -1 ? "" : ToString(round(1000 * peer.ping)),
peer.last_send == 0 ? "" : ToString(time_now - peer.last_send), peer.last_send == 0 ? "" : ToString(m_time_now - peer.last_send),
peer.last_recv == 0 ? "" : ToString(time_now - peer.last_recv), peer.last_recv == 0 ? "" : ToString(m_time_now - peer.last_recv),
peer.last_trxn == 0 ? "" : ToString((time_now - peer.last_trxn) / 60), peer.last_trxn == 0 ? "" : ToString((m_time_now - peer.last_trxn) / 60),
peer.last_blck == 0 ? "" : ToString((time_now - peer.last_blck) / 60), peer.last_blck == 0 ? "" : ToString((m_time_now - peer.last_blck) / 60),
peer.conn_time == 0 ? "" : ToString((time_now - peer.conn_time) / 60), peer.conn_time == 0 ? "" : ToString((m_time_now - peer.conn_time) / 60),
is_asmap_on ? 7 : 0, // variable spacing m_is_asmap_on ? 7 : 0, // variable spacing
is_asmap_on && peer.mapped_as != 0 ? ToString(peer.mapped_as) : "", m_is_asmap_on && peer.mapped_as != 0 ? ToString(peer.mapped_as) : "",
max_peer_id_length, // variable spacing m_max_id_length, // variable spacing
peer.id, peer.id,
IsAddressSelected() ? max_addr_length : 0, // variable spacing IsAddressSelected() ? m_max_addr_length : 0, // variable spacing
IsAddressSelected() ? peer.addr : "", IsAddressSelected() ? peer.addr : "",
IsVersionSelected() && version != "0" ? version : ""); IsVersionSelected() && version != "0" ? version : "");
} }
@ -485,12 +449,11 @@ public:
} }
// Report peer connection totals by type. // Report peer connection totals by type.
total_i = ipv4_i + ipv6_i + onion_i;
total_o = ipv4_o + ipv6_o + onion_o;
result += " ipv4 ipv6 onion total block-relay\n"; result += " ipv4 ipv6 onion total block-relay\n";
result += strprintf("in %5i %5i %5i %5i %5i\n", ipv4_i, ipv6_i, onion_i, total_i, block_relay_i); const std::array<std::string, 3> rows{{"in", "out", "total"}};
result += strprintf("out %5i %5i %5i %5i %5i\n", ipv4_o, ipv6_o, onion_o, total_o, block_relay_o); for (size_t i = 0; i < m_networks_size; ++i) {
result += strprintf("total %5i %5i %5i %5i %5i\n", ipv4_i + ipv4_o, ipv6_i + ipv6_o, onion_i + onion_o, total_i + total_o, block_relay_i + block_relay_o); result += strprintf("%-5s %5i %5i %5i %5i %5i\n", rows.at(i), m_counts.at(i).at(0), m_counts.at(i).at(1), m_counts.at(i).at(2), m_counts.at(i).at(m_networks_size), m_counts.at(i).at(m_networks_size + 1));
}
// Report local addresses, ports, and scores. // Report local addresses, ports, and scores.
result += "\nLocal addresses"; result += "\nLocal addresses";

View File

@ -599,6 +599,7 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
X(nServices); X(nServices);
X(addr); X(addr);
X(addrBind); X(addrBind);
stats.m_network = GetNetworkName(ConnectedThroughNetwork());
stats.m_mapped_as = addr.GetMappedAS(m_asmap); stats.m_mapped_as = addr.GetMappedAS(m_asmap);
if (!m_block_relay_only_peer) { if (!m_block_relay_only_peer) {
LOCK(m_tx_relay->cs_filter); LOCK(m_tx_relay->cs_filter);

View File

@ -809,6 +809,8 @@ public:
CAddress addr; CAddress addr;
// Bind address of our side of the connection // Bind address of our side of the connection
CAddress addrBind; CAddress addrBind;
// Name of the network the peer connected through
std::string m_network;
uint32_t m_mapped_as; uint32_t m_mapped_as;
// In case this is a verified MN, this value is the proTx of the MN // In case this is a verified MN, this value is the proTx of the MN
uint256 verifiedProRegTxHash; uint256 verifiedProRegTxHash;

View File

@ -90,6 +90,7 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
{RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"}, {RPCResult::Type::STR, "addr", "(host:port) The IP address and port of the peer"},
{RPCResult::Type::STR, "addrbind", "(ip:port) Bind address of the connection to the peer"}, {RPCResult::Type::STR, "addrbind", "(ip:port) Bind address of the connection to the peer"},
{RPCResult::Type::STR, "addrlocal", "(ip:port) Local address as reported by the peer"}, {RPCResult::Type::STR, "addrlocal", "(ip:port) Local address as reported by the peer"},
{RPCResult::Type::STR, "network", "Network (ipv4, ipv6, or onion) the peer connected through"},
{RPCResult::Type::STR, "mapped_as", "The AS in the BGP route to the peer used for diversifying peer selection"}, {RPCResult::Type::STR, "mapped_as", "The AS in the BGP route to the peer used for diversifying peer selection"},
{RPCResult::Type::STR_HEX, "services", "The services offered"}, {RPCResult::Type::STR_HEX, "services", "The services offered"},
{RPCResult::Type::STR_HEX, "verified_proregtx_hash", true /*optional*/, "Only present when the peer is a masternode and successfully " {RPCResult::Type::STR_HEX, "verified_proregtx_hash", true /*optional*/, "Only present when the peer is a masternode and successfully "
@ -161,10 +162,13 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); bool fStateStats = GetNodeStateStats(stats.nodeid, statestats);
obj.pushKV("id", stats.nodeid); obj.pushKV("id", stats.nodeid);
obj.pushKV("addr", stats.addrName); obj.pushKV("addr", stats.addrName);
if (!(stats.addrLocal.empty())) if (stats.addrBind.IsValid()) {
obj.pushKV("addrlocal", stats.addrLocal);
if (stats.addrBind.IsValid())
obj.pushKV("addrbind", stats.addrBind.ToString()); obj.pushKV("addrbind", stats.addrBind.ToString());
}
if (!(stats.addrLocal.empty())) {
obj.pushKV("addrlocal", stats.addrLocal);
}
obj.pushKV("network", stats.m_network);
if (stats.m_mapped_as != 0) { if (stats.m_mapped_as != 0) {
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as)); obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as));
} }

View File

@ -18,8 +18,9 @@ Test plan:
- proxy on IPv6 - proxy on IPv6
- Create various proxies (as threads) - Create various proxies (as threads)
- Create dashds that connect to them - Create nodes that connect to them
- Manipulate the dashds using addnode (onetry) an observe effects - Manipulate the peer connections using addnode (onetry) and observe effects
- Test the getpeerinfo `network` field for the peer
addnode connect to IPv4 addnode connect to IPv4
addnode connect to IPv6 addnode connect to IPv6
@ -40,6 +41,12 @@ from test_framework.util import (
from test_framework.netutil import test_ipv6_local from test_framework.netutil import test_ipv6_local
RANGE_BEGIN = PORT_MIN + 2 * PORT_RANGE # Start after p2p and rpc ports RANGE_BEGIN = PORT_MIN + 2 * PORT_RANGE # Start after p2p and rpc ports
# From GetNetworkName() in netbase.cpp:
NET_UNROUTABLE = ""
NET_IPV4 = "ipv4"
NET_IPV6 = "ipv6"
NET_ONION = "onion"
class ProxyTest(BitcoinTestFramework): class ProxyTest(BitcoinTestFramework):
def set_test_params(self): def set_test_params(self):
@ -90,10 +97,16 @@ class ProxyTest(BitcoinTestFramework):
self.add_nodes(self.num_nodes, extra_args=args) self.add_nodes(self.num_nodes, extra_args=args)
self.start_nodes() self.start_nodes()
def network_test(self, node, addr, network):
for peer in node.getpeerinfo():
if peer["addr"] == addr:
assert_equal(peer["network"], network)
def node_test(self, node, proxies, auth, test_onion=True): def node_test(self, node, proxies, auth, test_onion=True):
rv = [] rv = []
# Test: outgoing IPv4 connection through node addr = "15.61.23.23:1234"
node.addnode("15.61.23.23:1234", "onetry") self.log.debug("Test: outgoing IPv4 connection through node for address {}".format(addr))
node.addnode(addr, "onetry")
cmd = proxies[0].queue.get() cmd = proxies[0].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
# Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 # Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
@ -104,10 +117,12 @@ class ProxyTest(BitcoinTestFramework):
assert_equal(cmd.username, None) assert_equal(cmd.username, None)
assert_equal(cmd.password, None) assert_equal(cmd.password, None)
rv.append(cmd) rv.append(cmd)
self.network_test(node, addr, network=NET_IPV4)
if self.have_ipv6: if self.have_ipv6:
# Test: outgoing IPv6 connection through node addr = "[1233:3432:2434:2343:3234:2345:6546:4534]:5443"
node.addnode("[1233:3432:2434:2343:3234:2345:6546:4534]:5443", "onetry") self.log.debug("Test: outgoing IPv6 connection through node for address {}".format(addr))
node.addnode(addr, "onetry")
cmd = proxies[1].queue.get() cmd = proxies[1].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
# Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 # Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
@ -118,10 +133,12 @@ class ProxyTest(BitcoinTestFramework):
assert_equal(cmd.username, None) assert_equal(cmd.username, None)
assert_equal(cmd.password, None) assert_equal(cmd.password, None)
rv.append(cmd) rv.append(cmd)
self.network_test(node, addr, network=NET_IPV6)
if test_onion: if test_onion:
# Test: outgoing onion connection through node addr = "bitcoinostk4e4re.onion:8333"
node.addnode("bitcoinostk4e4re.onion:8333", "onetry") self.log.debug("Test: outgoing onion connection through node for address {}".format(addr))
node.addnode(addr, "onetry")
cmd = proxies[2].queue.get() cmd = proxies[2].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.atyp, AddressType.DOMAINNAME)
@ -131,9 +148,11 @@ class ProxyTest(BitcoinTestFramework):
assert_equal(cmd.username, None) assert_equal(cmd.username, None)
assert_equal(cmd.password, None) assert_equal(cmd.password, None)
rv.append(cmd) rv.append(cmd)
self.network_test(node, addr, network=NET_ONION)
# Test: outgoing DNS name connection through node addr = "node.noumenon:8333"
node.addnode("node.noumenon:8333", "onetry") self.log.debug("Test: outgoing DNS name connection through node for address {}".format(addr))
node.addnode(addr, "onetry")
cmd = proxies[3].queue.get() cmd = proxies[3].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.atyp, AddressType.DOMAINNAME)
@ -143,6 +162,7 @@ class ProxyTest(BitcoinTestFramework):
assert_equal(cmd.username, None) assert_equal(cmd.username, None)
assert_equal(cmd.password, None) assert_equal(cmd.password, None)
rv.append(cmd) rv.append(cmd)
self.network_test(node, addr, network=NET_UNROUTABLE)
return rv return rv
@ -197,5 +217,6 @@ 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)
if __name__ == '__main__': if __name__ == '__main__':
ProxyTest().main() ProxyTest().main()