Fix incorrect source issuer for XRP source

This commit is contained in:
JoelKatz
2014-12-03 11:54:57 -08:00
committed by Nik Bougalis
parent 36f8e4f2ad
commit a48120e675
2 changed files with 8 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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)
{