Off by one error. Thank you unit tests.

This commit is contained in:
JoelKatz
2013-04-07 23:34:37 -07:00
parent f78424a2d5
commit 950d6b3f55

View File

@@ -479,10 +479,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<int, uint160> >::iterator it = candidates.begin();
while (--count != 0)
while (count-- != 0)
{
STPath spNew(spPath);
STPathElement speNew(it->second, speEnd.mCurrencyID, it->second);