From a48120e675a1e98d8a7694dbb348f8d5c22b300a Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 3 Dec 2014 11:54:57 -0800 Subject: [PATCH] Fix incorrect source issuer for XRP source --- src/ripple/app/paths/PathState.cpp | 2 ++ src/ripple/app/paths/Pathfinder.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ripple/app/paths/PathState.cpp b/src/ripple/app/paths/PathState.cpp index 83c12927b..44a6603c9 100644 --- a/src/ripple/app/paths/PathState.cpp +++ b/src/ripple/app/paths/PathState.cpp @@ -438,6 +438,8 @@ TER PathState::expandPath ( if ((isXRP (uMaxCurrencyID) && !isXRP (uMaxIssuerID)) || (isXRP (currencyOutID) && !isXRP (issuerOutID))) { + WriteLog (lsDEBUG, RippleCalc) + << "expandPath> issuer with XRP"; terStatus = temBAD_PATH; } diff --git a/src/ripple/app/paths/Pathfinder.cpp b/src/ripple/app/paths/Pathfinder.cpp index 6872f3c3b..e541def8b 100644 --- a/src/ripple/app/paths/Pathfinder.cpp +++ b/src/ripple/app/paths/Pathfinder.cpp @@ -176,6 +176,7 @@ Pathfinder::Pathfinder ( mLedger (cache->getLedger ()), mRLCache (cache) { + assert (isXRP(uSrcCurrency) == isXRP(uSrcIssuer)); } Pathfinder::Pathfinder ( @@ -188,7 +189,11 @@ Pathfinder::Pathfinder ( mDstAccount (uDstAccount), mDstAmount (saDstAmount), mSrcCurrency (uSrcCurrency), - mSrcAmount ({uSrcCurrency, uSrcAccount}, 1u, 0, true), + mSrcAmount ( + { + uSrcCurrency, + isXRP (uSrcCurrency) ? xrpAccount () : uSrcAccount + }, 1u, 0, true), mLedger (cache->getLedger ()), mRLCache (cache) {