From f493590604363402c1189a1126a19cf50f3324bf Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Thu, 7 Aug 2014 18:14:55 -0400 Subject: [PATCH] Logic fix for multiquality issues. --- src/ripple/module/app/paths/cursor/AdvanceNode.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ripple/module/app/paths/cursor/AdvanceNode.cpp b/src/ripple/module/app/paths/cursor/AdvanceNode.cpp index 97d51b2a6..550a6ef49 100644 --- a/src/ripple/module/app/paths/cursor/AdvanceNode.cpp +++ b/src/ripple/module/app/paths/cursor/AdvanceNode.cpp @@ -24,10 +24,14 @@ namespace path { TER PathCursor::advanceNode (STAmount const& amount, bool reverse) const { - if (!multiQuality_ && amount != zero) + bool multi = multiQuality_ || amount == zero; + + // If the multiQuality_ is unchanged, use the PathCursor we're using now. + if (multi == multiQuality_) return advanceNode (reverse); - PathCursor withMultiQuality{rippleCalc_, pathState_, true, nodeIndex_}; + // Otherwise, use a new PathCursor with the new multiQuality_. + PathCursor withMultiQuality {rippleCalc_, pathState_, multi, nodeIndex_}; return withMultiQuality.advanceNode (reverse); }