From 2210dbac94e61f22676cc21dbeb73e82da77bb2b Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sun, 3 Nov 2013 16:37:35 -0800 Subject: [PATCH] Don't abort the path filtering loop too early. --- src/ripple_app/paths/Pathfinder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ripple_app/paths/Pathfinder.cpp b/src/ripple_app/paths/Pathfinder.cpp index 47effb728..3eb414f3d 100644 --- a/src/ripple_app/paths/Pathfinder.cpp +++ b/src/ripple_app/paths/Pathfinder.cpp @@ -350,7 +350,8 @@ STPathSet Pathfinder::filterPaths(int iMaxPaths, STPath& extraPath) std::sort (vMap.begin (), vMap.end (), bQualityCmp); // Lower is better and should be first. - for (int i = 0, iPathsLeft = iMaxPaths; (iPathsLeft > 0) && (i < vMap.size ()); ++i) + for (int i = 0, iPathsLeft = iMaxPaths; + ((iPathsLeft > 0) || (extraPath.size() == 0)) && (i < vMap.size ()); ++i) { path_LQ_t& lqt = vMap[i];