summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorMonica Moniot <[email protected]>2023-02-06 14:50:05 -0500
committerGitHub <[email protected]>2023-02-06 11:50:05 -0800
commit666fb7ea2d7993bd47d3062dca3bb8dd1e1a87a5 (patch)
tree86e0f807fc9628f3ffffcd8796fac0049503b354 /node
parentf0778860e54720577f85504a61ecdc3f5d3b0436 (diff)
eliminated duplicate paths (#1870)
Diffstat (limited to 'node')
-rw-r--r--node/Peer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp
index c1dc124c..62798e63 100644
--- a/node/Peer.cpp
+++ b/node/Peer.cpp
@@ -543,7 +543,6 @@ unsigned int Peer::doPingAndKeepalive(void *tPtr,int64_t now)
else break;
}
- unsigned int j = 0;
for(unsigned int i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) {
if (_paths[i].p) {
// Clean expired and reduced priority paths
@@ -553,9 +552,8 @@ unsigned int Peer::doPingAndKeepalive(void *tPtr,int64_t now)
_paths[i].p->sent(now);
sent |= (_paths[i].p->address().ss_family == AF_INET) ? 0x1 : 0x2;
}
- if (i != j)
- _paths[j] = _paths[i];
- ++j;
+ } else {
+ _paths[i] = _PeerPath();
}
} else break;
}