From 6af550800ae445f1b123ad3f8c27eaf4d46f91c7 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 29 Mar 2013 19:41:15 -0700 Subject: [PATCH] Explain the issue. --- src/cpp/ripple/Pathfinder.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cpp/ripple/Pathfinder.cpp b/src/cpp/ripple/Pathfinder.cpp index 73cbb0cf4b..d3c1be196a 100644 --- a/src/cpp/ripple/Pathfinder.cpp +++ b/src/cpp/ripple/Pathfinder.cpp @@ -609,7 +609,10 @@ bool Pathfinder::findPaths(const unsigned int iMaxSteps, const unsigned int iMax { std::sort(vMap.begin(), vMap.end(), bQualityCmp); // Lower is better and should be first. - // Output best quality entries. +// if (bFound) +// { // must subtract liquidity in default path from remaining amount WRITEME +// } + STAmount remaining = mDstAmount; for (int i = 0, iPathsLeft = iMaxPaths; (iPathsLeft > 0) && (i < vMap.size()); ++i) { @@ -624,12 +627,11 @@ bool Pathfinder::findPaths(const unsigned int iMaxSteps, const unsigned int iMax cLog(lsDEBUG) << "Skipping a non-filling path: " << vspResults[lqt.get<3>()].getJson(0); } - bFound = true; - - // The lines below break the unit test "Issues Path negative: ripple-client issue #23: smaller" -// bFound = remaining.isZero() || remaining.isNegative(); -// if (!bFound) +// if (remaining.isPositive()) +// { +// bFound = false; // cLog(lsWARNING) << "Paths could not send " << remaining << " of " << mDstAmount; +// | cLog(lsDEBUG) << boost::str(boost::format("findPaths: RESULTS: %s") % spsDst.getJson(0)); }