From 3e4cf426bde10589858de0d080c2710221e755c1 Mon Sep 17 00:00:00 2001 From: Mark Travis Date: Fri, 30 May 2014 09:27:01 +0000 Subject: [PATCH] Detect paths with illegal bridging offers --- src/ripple_app/paths/PathState.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ripple_app/paths/PathState.cpp b/src/ripple_app/paths/PathState.cpp index b44111c75..358a99256 100644 --- a/src/ripple_app/paths/PathState.cpp +++ b/src/ripple_app/paths/PathState.cpp @@ -356,13 +356,19 @@ TER PathState::pushNode ( if (!!pnCur.uCurrencyID != !!pnCur.uIssuerID) { - WriteLog (lsDEBUG, RippleCalc) << "pushNode: currency is inconsistent with issuer."; - + WriteLog (lsDEBUG, RippleCalc) << + "pushNode: currency is inconsistent with issuer."; terResult = temBAD_PATH; } - else if (!!pnPrv.uAccountID) + else if (pnPrv.uCurrencyID == pnCur.uCurrencyID && + pnPrv.uIssuerID == pnCur.uIssuerID) + { + WriteLog (lsDEBUG, RippleCalc) << + "pushNode: bad path: offer to same currency and issuer"; + terResult = temBAD_PATH; + } + else { - // Previous is an account. WriteLog (lsTRACE, RippleCalc) << "pushNode: imply for offer."; // Insert intermediary issuer account if needed.