diff --git a/src/cpp/ripple/Pathfinder.cpp b/src/cpp/ripple/Pathfinder.cpp index 3943271e09..1118a2fb6f 100644 --- a/src/cpp/ripple/Pathfinder.cpp +++ b/src/cpp/ripple/Pathfinder.cpp @@ -481,10 +481,14 @@ bool Pathfinder::findPaths(const unsigned int iMaxSteps, const unsigned int iMax std::sort(candidates.begin(), candidates.end(), BIND_TYPE(candCmp, mLedger->getLedgerSeq(), P_1, P_2)); int count = candidates.size(); - if (count > 10) + + if (count > 30) count /= 3; + else if (count > 10) + count /= 2; + std::vector< std::pair >::iterator it = candidates.begin(); - while (--count != 0) + while (count-- != 0) { STPath spNew(spPath); STPathElement speNew(it->second, speEnd.mCurrencyID, it->second);