From f4d4b3920dd91a23dcd02b7b3b6e8f21793885bb Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 3 Nov 2012 04:32:46 -0700 Subject: [PATCH] Fix ripple best path determination. --- src/RippleCalc.cpp | 4 ++-- test/send-test.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RippleCalc.cpp b/src/RippleCalc.cpp index 2e78779a3e..d4ba49a39e 100644 --- a/src/RippleCalc.cpp +++ b/src/RippleCalc.cpp @@ -2109,8 +2109,8 @@ int iPass = 0; assert(!!pspCur->saInPass && !!pspCur->saOutPass); if ((!bLimitQuality || pspCur->uQuality <= uQualityLimit) // Quality is not limted or increment has allowed quality. - || !pspBest // Best is not yet set. - || PathState::lessPriority(pspBest, pspCur)) // Current is better than set. + && (!pspBest // Best is not yet set. + || PathState::lessPriority(pspBest, pspCur))) // Current is better than set. { cLog(lsDEBUG) << boost::str(boost::format("rippleCalc: better: uQuality=%s saInPass=%s saOutPass=%s") % STAmount::saFromRate(pspCur->uQuality) diff --git a/test/send-test.js b/test/send-test.js index 08f655a197..2de3fd7f80 100644 --- a/test/send-test.js +++ b/test/send-test.js @@ -646,10 +646,10 @@ buster.testCase("Indirect ripple", { testutils.verify_balances(self.remote, { - "alice" : [ "-50/USD/bob", "-100/USD/carol" ], + "alice" : [ "-100/USD/bob", "-50/USD/carol" ], "amazon" : "150/USD/mtgox", - "bob" : "50/USD/mtgox", - "carol" : "0/USD/mtgox", + "bob" : "0/USD/mtgox", + "carol" : "50/USD/mtgox", }, callback); }, @@ -737,10 +737,10 @@ buster.testCase("Indirect ripple", { testutils.verify_balances(self.remote, { - "alice" : [ "-65.00000000000001/USD/bob", "-100/USD/carol" ], + "alice" : [ "-100/USD/bob", "-65.00000000000001/USD/carol" ], "amazon" : "150/USD/mtgox", - "bob" : "35/USD/mtgox", - "carol" : "0/USD/mtgox", + "bob" : "0/USD/mtgox", + "carol" : "35/USD/mtgox", }, callback); },