Skip to content

Commit af9103c

Browse files
committed
net, rpc: change CNodeStats::m_network from string to Network
1 parent cc592a8 commit af9103c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
566566
X(nServices);
567567
X(addr);
568568
X(addrBind);
569-
stats.m_network = GetNetworkName(ConnectedThroughNetwork());
569+
stats.m_network = ConnectedThroughNetwork();
570570
stats.m_mapped_as = addr.GetMappedAS(m_asmap);
571571
if (m_tx_relay != nullptr) {
572572
LOCK(m_tx_relay->cs_filter);

src/net.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ class CNodeStats
722722
CAddress addr;
723723
// Bind address of our side of the connection
724724
CAddress addrBind;
725-
// Name of the network the peer connected through
726-
std::string m_network;
725+
// Network the peer connected through
726+
Network m_network;
727727
uint32_t m_mapped_as;
728728
std::string m_conn_type_string;
729729
};

src/rpc/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static RPCHelpMan getpeerinfo()
188188
if (!(stats.addrLocal.empty())) {
189189
obj.pushKV("addrlocal", stats.addrLocal);
190190
}
191-
obj.pushKV("network", stats.m_network);
191+
obj.pushKV("network", GetNetworkName(stats.m_network));
192192
if (stats.m_mapped_as != 0) {
193193
obj.pushKV("mapped_as", uint64_t(stats.m_mapped_as));
194194
}

0 commit comments

Comments
 (0)