From 96bc727fcb085afd35705c2e05ed54e46b3656dc Mon Sep 17 00:00:00 2001 From: seelabs Date: Tue, 26 Jan 2016 16:22:58 -0500 Subject: [PATCH] Enforce no-ripple constraints --- src/ripple/app/paths/PathState.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ripple/app/paths/PathState.cpp b/src/ripple/app/paths/PathState.cpp index e3a80438d6..e530528639 100644 --- a/src/ripple/app/paths/PathState.cpp +++ b/src/ripple/app/paths/PathState.cpp @@ -799,6 +799,19 @@ TER PathState::checkNoRipple ( if (terStatus != tesSUCCESS) return terStatus; } + + if (!nodes_[i - 1].isAccount() && + nodes_[i].isAccount() && + nodes_[i + 1].isAccount() && + nodes_[i -1].issue_.account != nodes_[i].account_) + { // offer -> account -> account + auto const& currencyID = nodes_[i].issue_.currency; + terStatus = checkNoRipple ( + nodes_[i-1].issue_.account, nodes_[i].account_, nodes_[i+1].account_, + currencyID); + if (terStatus != tesSUCCESS) + return terStatus; + } } return tesSUCCESS;