Browse Source

Add logic short-circuit to avoid unnecessary bond rebuild logic when appropriate

Joseph Henry 2 years ago
parent
commit
0e23ba8f1a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      node/Bond.cpp

+ 4 - 0
node/Bond.cpp

@@ -980,6 +980,10 @@ void Bond::curateBond(int64_t now, bool rebuildBond)
 		dumpInfo(now, true);
 		dumpInfo(now, true);
 	}
 	}
 
 
+	if (! _numAliveLinks && ! _numTotalLinks) {
+		return;
+	}
+
 	/**
 	/**
 	 * Curate the set of paths that are part of the bond proper. Select a set of paths
 	 * Curate the set of paths that are part of the bond proper. Select a set of paths
 	 * per logical link according to eligibility and user-specified constraints.
 	 * per logical link according to eligibility and user-specified constraints.