Freeze flags: (RIPD-394)

* Define all flags
 * Set/clear bits in transactors
 * Frozen line counts towards reserve, is non-default
 * Report trust line state
This commit is contained in:
JoelKatz
2014-05-22 14:22:15 -07:00
committed by David Schwartz
parent 07db5d497c
commit 4cf29455e4
9 changed files with 79 additions and 1 deletions

View File

@@ -1367,6 +1367,7 @@ TER LedgerEntrySet::trustCreate (
SLE::ref sleAccount, // --> the account being set.
const bool bAuth, // --> authorize account.
const bool bNoRipple, // --> others cannot ripple through
const bool bFreeze, // --> funds cannot leave
const STAmount& saBalance, // --> balance of account being set.
// Issuer should be noAccount()
const STAmount& saLimit, // --> limit for account being set.
@@ -1435,6 +1436,10 @@ TER LedgerEntrySet::trustCreate (
{
uFlags |= (bSetHigh ? lsfHighNoRipple : lsfLowNoRipple);
}
if (bFreeze)
{
uFlags |= (!bSetHigh ? lsfLowFreeze : lsfHighFreeze);
}
sleRippleState->setFieldU32 (sfFlags, uFlags);
ownerCountAdjust (
@@ -1536,6 +1541,7 @@ TER LedgerEntrySet::rippleCredit (
entryCache (ltACCOUNT_ROOT, Ledger::getAccountRootIndex (uReceiverID)),
false,
false,
false,
saBalance,
saReceiverLimit);
}
@@ -1568,6 +1574,7 @@ TER LedgerEntrySet::rippleCredit (
&& (uFlags & (!bSenderHigh ? lsfLowReserve : lsfHighReserve))
// Sender reserve is set.
&& !(uFlags & (!bSenderHigh ? lsfLowNoRipple : lsfHighNoRipple))
&& !(uFlags & (!bSenderHigh ? lsfLowFreeze : lsfHighFreeze))
&& !sleRippleState->getFieldAmount (
!bSenderHigh ? sfLowLimit : sfHighLimit)
// Sender trust limit is 0.