20 #include <ripple/app/misc/HashRouter.h>
21 #include <ripple/app/tx/apply.h>
22 #include <ripple/app/tx/applySteps.h>
23 #include <ripple/basics/Log.h>
24 #include <ripple/protocol/Feature.h>
29 #define SF_SIGBAD SF_PRIVATE1 // Signature is bad
30 #define SF_SIGGOOD SF_PRIVATE2 // Signature is good
31 #define SF_LOCALBAD SF_PRIVATE3 // Local checks failed
32 #define SF_LOCALGOOD SF_PRIVATE4 // Local checks passed
44 auto const flags = router.
getFlags(
id);
45 if (flags & SF_SIGBAD)
49 if (!(flags & SF_SIGGOOD))
52 auto const requireCanonicalSig =
57 auto const sigVerify = tx.
checkSign(requireCanonicalSig, rules);
67 if (flags & SF_LOCALBAD)
72 if (flags & SF_LOCALGOOD)
95 flags |= SF_LOCALGOOD;
120 auto pcresult =
preclaim(pfresult, app, view);
121 return doApply(pcresult, app, view);
138 << (retryAssured ?
"/retry" :
"/final");
142 auto const result =
apply(app, view, txn, flags, j);
146 <<
"Transaction applied: " <<
transHuman(result.first);
155 <<
"Transaction failure: " <<
transHuman(result.first);
164 JLOG(j.
warn()) <<
"Throws: " << ex.
what();
RAII class to set and restore the STAmount canonicalize switchover.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
std::pair< TER, bool > apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
int getFlags(uint256 const &key)
Writable ledger view that accumulates state and tx changes.
ApplyResult applyTransaction(Application &app, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
Transaction application helper.
RAII class to set and restore the Number switchover.
const uint256 fixSTAmountCanonicalize
Validity
Describes the pre-processing validity of a transaction.
PreflightResult preflight(Application &app, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
Gate a transaction based on static information.
ApplyResult
Enum class for return value from applyTransaction
Routing table for objects identified by hash.
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
@ SigGoodOnly
Signature is good, but local checks fail.
const uint256 featureRequireFullyCanonicalSig
std::pair< Validity, std::string > checkValidity(HashRouter &router, STTx const &tx, Rules const &rules, Config const &config)
Checks transaction signature and local checks.
std::pair< TER, bool > doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
bool passesLocalChecks(STObject const &st, std::string &reason)
@ Retry
Should be retried in this ledger.
A generic endpoint for log messages.
@ Success
Applied to this ledger.
std::string transHuman(TER code)
uint256 getTransactionID() const
PreclaimResult preclaim(PreflightResult const &preflightResult, Application &app, OpenView const &view)
Gate a transaction based on static ledger information.
@ Fail
Should not be retried in this ledger.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Expected< void, std::string > checkSign(RequireFullyCanonicalSig requireCanonicalSig, Rules const &rules) const
@ Valid
Signature and local checks are good / passed.
const uint256 fixUniversalNumber
Rules controlling protocol behavior.
@ SigBad
Signature is bad. Didn't do local checks.
Rules const & rules() const override
Returns the tx processing rules.
bool setFlags(uint256 const &key, int flags)
Set the flags on a hash.
bool isTemMalformed(TER x)