浏览代码

Add new replacement condition in peer path redundancy logic to fix duplicate paths

Joseph Henry 5 年之前
父节点
当前提交
a1b2ff772a
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      node/Peer.cpp

+ 3 - 0
node/Peer.cpp

@@ -139,6 +139,9 @@ void Peer::received(
 						if (q > replacePathQuality) {
 						if (q > replacePathQuality) {
 							replacePathQuality = q;
 							replacePathQuality = q;
 							replacePath = i;
 							replacePath = i;
+							if (!_paths[i].p->alive(now)) {
+								break; // Stop searching, we found an identical dead path, replace the object
+							}
 						}
 						}
 					} else {
 					} else {
 						replacePath = i;
 						replacePath = i;