3#include <xrpl/basics/Log.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/ledger/View.h>
7#include <xrpl/protocol/AccountID.h>
8#include <xrpl/protocol/UintTypes.h>
19 XRPL_ASSERT(src != dst,
"xrpl::checkFreeze : unequal input accounts");
24 if (sle->isFlag(lsfGlobalFreeze))
32 if (sle->isFlag((dst > src) ? lsfHighFreeze : lsfLowFreeze))
38 if (sle->isFlag(lsfHighDeepFreeze) || sle->isFlag(lsfLowDeepFreeze))
47 sleDst && sleDst->isFieldPresent(sfAMMID))
54 view, src, (*sleAmm)[sfAsset].get<
Issue>(), (*sleAmm)[sfAsset2].get<
Issue>()))
78 if (!sleIn || !sleOut)
81 if ((*sleIn)[sfFlags] & ((cur > prev) ? lsfHighNoRipple : lsfLowNoRipple) &&
82 (*sleOut)[sfFlags] & ((cur > next) ? lsfHighNoRipple : lsfLowNoRipple))
84 JLOG(j.
info()) <<
"Path violates noRipple constraint between " << prev <<
", " << cur
A generic endpoint for log messages.
A currency issued by an account.
virtual Rules const & rules() const =0
Returns the tx processing rules.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Keylet amm(Asset const &issue1, Asset const &issue2) noexcept
AMM entry.
Keylet line(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
Keylet account(AccountID const &id) noexcept
AccountID root.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
TERSubset< CanCvtToTER > TER
TER checkFreeze(ReadView const &view, AccountID const &src, AccountID const &dst, Currency const ¤cy)
TER checkNoRipple(ReadView const &view, AccountID const &prev, AccountID const &cur, AccountID const &next, Currency const ¤cy, beast::Journal j)
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)