Fix setting the no ripple flag when a trust line is created.

This commit is contained in:
JoelKatz
2013-10-23 17:24:34 -07:00
parent c11abb42d1
commit 9ff65d0da4
3 changed files with 8 additions and 0 deletions

View File

@@ -1347,6 +1347,7 @@ TER LedgerEntrySet::trustCreate (
uint256 const& uIndex, // --> ripple state entry
SLE::ref sleAccount, // --> the account being set.
const bool bAuth, // --> authorize account.
const bool bNoRipple, // --> others cannot ripple through
const STAmount& saBalance, // --> balance of account being set. Issuer should be ACCOUNT_ONE
const STAmount& saLimit, // --> limit for account being set. Issuer should be the account being set.
const uint32 uQualityIn,
@@ -1398,6 +1399,10 @@ TER LedgerEntrySet::trustCreate (
{
uFlags |= (!bSetHigh ? lsfLowAuth : lsfHighAuth);
}
if (bNoRipple)
{
uFlags |= (!bSetHigh ? lsfLowNoRipple : lsfHighNoRipple);
}
sleRippleState->setFieldU32 (sfFlags, uFlags);
@@ -1475,6 +1480,7 @@ TER LedgerEntrySet::rippleCredit (const uint160& uSenderID, const uint160& uRece
uIndex,
entryCache (ltACCOUNT_ROOT, Ledger::getAccountRootIndex (uReceiverID)),
false,
false,
saBalance,
saReceiverLimit);
}

View File

@@ -212,6 +212,7 @@ public:
uint256 const & uIndex,
SLE::ref sleAccount,
const bool bAuth,
const bool bNoRipple,
const STAmount & saSrcBalance,
const STAmount & saSrcLimit,
const uint32 uSrcQualityIn = 0,

View File

@@ -349,6 +349,7 @@ TER TrustSetTransactor::doApply ()
Ledger::getRippleStateIndex (mTxnAccountID, uDstAccountID, uCurrencyID),
mTxnAccount,
bSetAuth,
bSetNoRipple && !bClearNoRipple,
saBalance,
saLimitAllow, // Limit for who is being charged.
uQualityIn,