本文整理汇总了C++中sle::pointer::isFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ pointer::isFlag方法的具体用法?C++ pointer::isFlag怎么用?C++ pointer::isFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sle::pointer
的用法示例。
在下文中一共展示了pointer::isFlag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkFreeze
/** Check if an expanded path violates freeze rules */
void PathState::checkFreeze()
{
assert (nodes_.size() >= 2);
// A path with no intermediaries -- pure issue/redeem
// cannot be frozen.
if (nodes_.size() == 2)
return;
SLE::pointer sle;
for (std::size_t i = 0; i < (nodes_.size() - 1); ++i)
{
// Check each order book for a global freeze
if (nodes_[i].uFlags & STPathElement::typeIssuer)
{
sle = view().peek (keylet::account(nodes_[i].issue_.account));
if (sle && sle->isFlag (lsfGlobalFreeze))
{
terStatus = terNO_LINE;
return;
}
}
// Check each account change to make sure funds can leave
if (nodes_[i].uFlags & STPathElement::typeAccount)
{
Currency const& currencyID = nodes_[i].issue_.currency;
AccountID const& inAccount = nodes_[i].account_;
AccountID const& outAccount = nodes_[i+1].account_;
if (inAccount != outAccount)
{
sle = view().peek (keylet::account(outAccount));
if (sle && sle->isFlag (lsfGlobalFreeze))
{
terStatus = terNO_LINE;
return;
}
sle = view().peek (keylet::line(inAccount,
outAccount, currencyID));
if (sle && sle->isFlag (
(outAccount > inAccount) ? lsfHighFreeze : lsfLowFreeze))
{
terStatus = terNO_LINE;
return;
}
}
}
}
}
示例2: checkFreeze
/** Check if an expanded path violates freeze rules */
void PathState::checkFreeze()
{
assert(vpnNodes.size() >= 2);
// A path with no intermediaries -- pure issue/redeem
// cannot be frozen.
if(vpnNodes.size() == 2)
return;
for(std::size_t i = 0; i < (vpnNodes.size() - 1); ++i)
{
// Check each account change to make sure funds can leave
if(vpnNodes[i].uFlags & STPathElement::typeAccount)
{
uint160 const& currencyID = vpnNodes[i].uCurrencyID;
uint160 const& inAccount = vpnNodes[i].uAccountID;
uint160 const& issuingAccount = vpnNodes[i+1].uAccountID;
if(inAccount != issuingAccount)
{
SLE::pointer sle = lesEntries.entryCache(ltACCOUNT_ROOT,
Ledger::getAccountRootIndex(issuingAccount));
if(sle && sle->isFlag(lsfRequireAuth))
{
sle = lesEntries.entryCache(ltRIPPLE_STATE,
Ledger::getRippleStateIndex(inAccount,
issuingAccount, currencyID));
if(sle && !sle->isFlag(
(issuingAccount > inAccount) ? lsfHighAuth : lsfLowAuth))
{
terStatus = terNO_LINE;
return;
}
}
}
}
}
}
示例3: removeSignersFromLedger
TER
SetSignerList::destroySignerList ()
{
auto const accountKeylet = keylet::account (account_);
// Destroying the signer list is only allowed if either the master key
// is enabled or there is a regular key.
SLE::pointer ledgerEntry = view().peek (accountKeylet);
if ((ledgerEntry->isFlag (lsfDisableMaster)) &&
(!ledgerEntry->isFieldPresent (sfRegularKey)))
return tecNO_ALTERNATIVE_KEY;
auto const ownerDirKeylet = keylet::ownerDir (account_);
auto const signerListKeylet = keylet::signers (account_);
return removeSignersFromLedger(
accountKeylet, ownerDirKeylet, signerListKeylet);
}