From aec792f5b845fa73052d4ad8703665502d68fe0f Mon Sep 17 00:00:00 2001 From: sublimator Date: Tue, 24 Jun 2014 18:02:33 -0400 Subject: [PATCH] Restore checkpointed ledger under all paths in PathFind. --- src/ripple/module/app/paths/RippleCalc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ripple/module/app/paths/RippleCalc.cpp b/src/ripple/module/app/paths/RippleCalc.cpp index bfe7421b2..d00f5783f 100644 --- a/src/ripple/module/app/paths/RippleCalc.cpp +++ b/src/ripple/module/app/paths/RippleCalc.cpp @@ -214,7 +214,7 @@ TER rippleCalculate ( while (resultCode == temUNCERTAIN) { int iBest = -1; - const LedgerEntrySet lesCheckpoint = activeLedger; + LedgerEntrySet lesCheckpoint = activeLedger; int iDry = 0; // True, if ever computed multi-quality. @@ -415,6 +415,10 @@ TER rippleCalculate ( } else { + // We must restore the activeLedger from lesCheckpoint in the case + // when iBest is -1 and just before the result is set to tesSUCCESS. + + activeLedger.swapWith (lesCheckpoint); resultCode = tesSUCCESS; } }