diff --git a/src/ripple/module/app/paths/Pathfinder.cpp b/src/ripple/module/app/paths/Pathfinder.cpp index 785cc36bb..af4c16435 100644 --- a/src/ripple/module/app/paths/Pathfinder.cpp +++ b/src/ripple/module/app/paths/Pathfinder.cpp @@ -218,6 +218,8 @@ bool Pathfinder::findPaths ( if (costedPath.first <= iLevel) { getPaths(costedPath.second); + if (mCompletePaths.size () > PATHFINDER_MAX_COMPLETE_PATHS) + break; } } diff --git a/src/ripple/module/app/paths/Tuning.h b/src/ripple/module/app/paths/Tuning.h index 4c2d61ce4..cdf4e3e3e 100644 --- a/src/ripple/module/app/paths/Tuning.h +++ b/src/ripple/module/app/paths/Tuning.h @@ -25,7 +25,7 @@ namespace ripple { // VFALCO TODO Why 40? is the number 40 part of protocol? const int CALC_NODE_DELIVER_MAX_LOOPS = 40; const int NODE_ADVANCE_MAX_LOOPS = 100; - +const int PATHFINDER_MAX_COMPLETE_PATHS = 1000; } // ripple #endif