Skip to content

Commit fa9eade

Browse files
author
MarcoFalke
committed

File tree

9 files changed

+11
-19
lines changed

9 files changed

+11
-19
lines changed

doc/tracing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ For example:
147147
```C++
148148
TRACE6(net, inbound_message,
149149
pnode->GetId(),
150-
pnode->GetAddrName().c_str(),
150+
pnode->m_addr_name.c_str(),
151151
pnode->ConnectionTypeAsString().c_str(),
152152
sanitizedType.c_str(),
153153
msg.data.size(),

src/net.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ CNode* CConnman::FindNode(const std::string& addrName)
331331
{
332332
LOCK(cs_vNodes);
333333
for (CNode* pnode : vNodes) {
334-
if (pnode->GetAddrName() == addrName) {
334+
if (pnode->m_addr_name == addrName) {
335335
return pnode;
336336
}
337337
}
@@ -530,11 +530,6 @@ std::string ConnectionTypeAsString(ConnectionType conn_type)
530530
assert(false);
531531
}
532532

533-
std::string CNode::GetAddrName() const
534-
{
535-
return m_addr_name;
536-
}
537-
538533
CService CNode::GetAddrLocal() const
539534
{
540535
LOCK(cs_addrLocal);
@@ -577,7 +572,7 @@ void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap)
577572
X(nLastBlockTime);
578573
X(nTimeConnected);
579574
X(nTimeOffset);
580-
stats.addrName = GetAddrName();
575+
X(m_addr_name);
581576
X(nVersion);
582577
{
583578
LOCK(cs_SubVer);
@@ -2127,7 +2122,7 @@ std::vector<AddedNodeInfo> CConnman::GetAddedNodeInfo() const
21272122
if (pnode->addr.IsValid()) {
21282123
mapConnected[pnode->addr] = pnode->IsInboundConn();
21292124
}
2130-
std::string addrName = pnode->GetAddrName();
2125+
std::string addrName{pnode->m_addr_name};
21312126
if (!addrName.empty()) {
21322127
mapConnectedByName[std::move(addrName)] = std::make_pair(pnode->IsInboundConn(), static_cast<const CService&>(pnode->addr));
21332128
}
@@ -3004,7 +2999,7 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
30042999

30053000
TRACE6(net, outbound_message,
30063001
pnode->GetId(),
3007-
pnode->GetAddrName().c_str(),
3002+
pnode->m_addr_name.c_str(),
30083003
pnode->ConnectionTypeAsString().c_str(),
30093004
msg.m_type.c_str(),
30103005
msg.data.size(),

src/net.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class CNodeStats
248248
int64_t nLastBlockTime;
249249
int64_t nTimeConnected;
250250
int64_t nTimeOffset;
251-
std::string addrName;
251+
std::string m_addr_name;
252252
int nVersion;
253253
std::string cleanSubVer;
254254
bool fInbound;
@@ -659,8 +659,6 @@ class CNode
659659
return nLocalServices;
660660
}
661661

662-
std::string GetAddrName() const;
663-
664662
std::string ConnectionTypeAsString() const { return ::ConnectionTypeAsString(m_conn_type); }
665663

666664
/** A ping-pong round trip has completed successfully. Update latest and minimum ping times. */

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4086,7 +4086,7 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
40864086

40874087
TRACE6(net, inbound_message,
40884088
pfrom->GetId(),
4089-
pfrom->GetAddrName().c_str(),
4089+
pfrom->m_addr_name.c_str(),
40904090
pfrom->ConnectionTypeAsString().c_str(),
40914091
msg.m_command.c_str(),
40924092
msg.m_recv.size(),

src/qt/peertablemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ QVariant PeerTableModel::data(const QModelIndex& index, int role) const
7272
case NetNodeId:
7373
return (qint64)rec->nodeStats.nodeid;
7474
case Address:
75-
return QString::fromStdString(rec->nodeStats.addrName);
75+
return QString::fromStdString(rec->nodeStats.m_addr_name);
7676
case Direction:
7777
return QString(rec->nodeStats.fInbound ?
7878
//: An Inbound Connection from a Peer.

src/qt/peertablesortproxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd
2525
case PeerTableModel::NetNodeId:
2626
return left_stats.nodeid < right_stats.nodeid;
2727
case PeerTableModel::Address:
28-
return left_stats.addrName.compare(right_stats.addrName) < 0;
28+
return left_stats.m_addr_name.compare(right_stats.m_addr_name) < 0;
2929
case PeerTableModel::Direction:
3030
return left_stats.fInbound > right_stats.fInbound; // default sort Inbound, then Outbound
3131
case PeerTableModel::ConnectionType:

src/qt/rpcconsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ void RPCConsole::updateDetailWidget()
11291129
}
11301130
const auto stats = selected_peers.first().data(PeerTableModel::StatsRole).value<CNodeCombinedStats*>();
11311131
// update the detail ui with latest node information
1132-
QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + " ");
1132+
QString peerAddrDetails(QString::fromStdString(stats->nodeStats.m_addr_name) + " ");
11331133
peerAddrDetails += tr("(peer: %1)").arg(QString::number(stats->nodeStats.nodeid));
11341134
if (!stats->nodeStats.addrLocal.empty())
11351135
peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));

src/rpc/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static RPCHelpMan getpeerinfo()
197197
CNodeStateStats statestats;
198198
bool fStateStats = peerman.GetNodeStateStats(stats.nodeid, statestats);
199199
obj.pushKV("id", stats.nodeid);
200-
obj.pushKV("addr", stats.addrName);
200+
obj.pushKV("addr", stats.m_addr_name);
201201
if (stats.addrBind.IsValid()) {
202202
obj.pushKV("addrbind", stats.addrBind.ToString());
203203
}

src/test/fuzz/net.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ FUZZ_TARGET_INIT(net, initialize_net)
7979
}
8080

8181
(void)node.GetAddrLocal();
82-
(void)node.GetAddrName();
8382
(void)node.GetId();
8483
(void)node.GetLocalNonce();
8584
(void)node.GetLocalServices();

0 commit comments

Comments
 (0)