mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
net, rpc: change CNodeStats::m_network from string to Network
This commit is contained in:
parent
cc592a85ea
commit
af9103cc79
3 changed files with 4 additions and 4 deletions
|
@ -566,7 +566,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_network = ConnectedThroughNetwork();
|
||||||
stats.m_mapped_as = addr.GetMappedAS(m_asmap);
|
stats.m_mapped_as = addr.GetMappedAS(m_asmap);
|
||||||
if (m_tx_relay != nullptr) {
|
if (m_tx_relay != nullptr) {
|
||||||
LOCK(m_tx_relay->cs_filter);
|
LOCK(m_tx_relay->cs_filter);
|
||||||
|
|
|
@ -722,8 +722,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
|
// Network the peer connected through
|
||||||
std::string m_network;
|
Network m_network;
|
||||||
uint32_t m_mapped_as;
|
uint32_t m_mapped_as;
|
||||||
std::string m_conn_type_string;
|
std::string m_conn_type_string;
|
||||||
};
|
};
|
||||||
|
|
|
@ -188,7 +188,7 @@ static RPCHelpMan getpeerinfo()
|
||||||
if (!(stats.addrLocal.empty())) {
|
if (!(stats.addrLocal.empty())) {
|
||||||
obj.pushKV("addrlocal", stats.addrLocal);
|
obj.pushKV("addrlocal", stats.addrLocal);
|
||||||
}
|
}
|
||||||
obj.pushKV("network", stats.m_network);
|
obj.pushKV("network", GetNetworkName(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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue