Skip to content

Commit 9ff0a51

Browse files
committed
scripted-diff: net: Use accessor rather than node's id directly
-BEGIN VERIFY SCRIPT- sed -i "s/\(node\|to\|from\)->id/\1->GetId()/" src/net.cpp src/net_processing.cpp -END VERIFY SCRIPT-
1 parent e50c33e commit 9ff0a51

File tree

2 files changed

+55
-55
lines changed

2 files changed

+55
-55
lines changed

src/net.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ bool CConnman::AttemptToEvictConnection()
946946
continue;
947947
if (node->fDisconnect)
948948
continue;
949-
NodeEvictionCandidate candidate = {node->id, node->nTimeConnected, node->nMinPingUsecTime,
949+
NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime,
950950
node->nLastBlockTime, node->nLastTXTime,
951951
(node->nServices & nRelevantServices) == nRelevantServices,
952952
node->fRelayTxes, node->pfilter != NULL, node->addr, node->nKeyedNetGroup};
@@ -1372,7 +1372,7 @@ void CConnman::ThreadSocketHandler()
13721372
{
13731373
if (pnode->nLastRecv == 0 || pnode->nLastSend == 0)
13741374
{
1375-
LogPrint(BCLog::NET, "socket no message in first 60 seconds, %d %d from %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->id);
1375+
LogPrint(BCLog::NET, "socket no message in first 60 seconds, %d %d from %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->GetId());
13761376
pnode->fDisconnect = true;
13771377
}
13781378
else if (nTime - pnode->nLastSend > TIMEOUT_INTERVAL)
@@ -1392,7 +1392,7 @@ void CConnman::ThreadSocketHandler()
13921392
}
13931393
else if (!pnode->fSuccessfullyConnected)
13941394
{
1395-
LogPrintf("version handshake timeout from %d\n", pnode->id);
1395+
LogPrintf("version handshake timeout from %d\n", pnode->GetId());
13961396
pnode->fDisconnect = true;
13971397
}
13981398
}
@@ -2485,7 +2485,7 @@ bool CConnman::DisconnectNode(NodeId id)
24852485
{
24862486
LOCK(cs_vNodes);
24872487
for(CNode* pnode : vNodes) {
2488-
if (id == pnode->id) {
2488+
if (id == pnode->GetId()) {
24892489
pnode->fDisconnect = true;
24902490
return true;
24912491
}
@@ -2742,7 +2742,7 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
27422742
{
27432743
size_t nMessageSize = msg.data.size();
27442744
size_t nTotalSize = nMessageSize + CMessageHeader::HEADER_SIZE;
2745-
LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", SanitizeString(msg.command.c_str()), nMessageSize, pnode->id);
2745+
LogPrint(BCLog::NET, "sending %s (%d bytes) peer=%d\n", SanitizeString(msg.command.c_str()), nMessageSize, pnode->GetId());
27462746

27472747
std::vector<unsigned char> serializedHeader;
27482748
serializedHeader.reserve(CMessageHeader::HEADER_SIZE);
@@ -2780,7 +2780,7 @@ bool CConnman::ForNode(NodeId id, std::function<bool(CNode* pnode)> func)
27802780
CNode* found = nullptr;
27812781
LOCK(cs_vNodes);
27822782
for (auto&& pnode : vNodes) {
2783-
if(pnode->id == id) {
2783+
if(pnode->GetId() == id) {
27842784
found = pnode;
27852785
break;
27862786
}

0 commit comments

Comments
 (0)