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

View File

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

View File

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