aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-25 14:25:45 +0100
committerJon Atack <jon@atack.com>2020-12-27 14:28:31 +0100
commitaf9103cc792e17f35249f1d4cb30f0d6958ceb75 (patch)
tree52bdedf71cd7b905d104f9b573ac020205a99efd
parentcc592a85ea0c371f7269dbcad32857c181b657d1 (diff)
net, rpc: change CNodeStats::m_network from string to Network
-rw-r--r--src/net.cpp2
-rw-r--r--src/net.h4
-rw-r--r--src/rpc/net.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 7df0d11d37..d07b0ba0c0 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -566,7 +566,7 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
X(nServices);
X(addr);
X(addrBind);
- stats.m_network = GetNetworkName(ConnectedThroughNetwork());
+ stats.m_network = ConnectedThroughNetwork();
stats.m_mapped_as = addr.GetMappedAS(m_asmap);
if (m_tx_relay != nullptr) {
LOCK(m_tx_relay->cs_filter);
diff --git a/src/net.h b/src/net.h
index 1520a54686..faf1782086 100644
--- a/src/net.h
+++ b/src/net.h
@@ -722,8 +722,8 @@ public:
CAddress addr;
// Bind address of our side of the connection
CAddress addrBind;
- // Name of the network the peer connected through
- std::string m_network;
+ // Network the peer connected through
+ Network m_network;
uint32_t m_mapped_as;
std::string m_conn_type_string;
};
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 333dcb52bd..5aee2baaaf 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -188,7 +188,7 @@ static RPCHelpMan getpeerinfo()
if (!(stats.addrLocal.empty())) {
obj.pushKV("addrlocal", stats.addrLocal);
}
- obj.pushKV("network", stats.m_network);
+ obj.pushKV("network", GetNetworkName(stats.m_network));
if (stats.m_mapped_as != 0) {
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as));
}