mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Perform Transactor checks early (RIPD-751):
Certain checks that determine if a transaction is malformed can be performed without needing to look up accounts or access the ledger. Perform those checks as early as possible to optimize transaction processing.
This commit is contained in:
@@ -54,27 +54,30 @@ public:
|
||||
|
||||
}
|
||||
|
||||
TER doApply () override
|
||||
TER preCheck () override
|
||||
{
|
||||
std::uint32_t const uTxFlags = mTxn.getFlags ();
|
||||
|
||||
if (uTxFlags & tfUniversalMask)
|
||||
{
|
||||
m_journal.trace <<
|
||||
if (m_journal.trace) m_journal.trace <<
|
||||
"Malformed transaction: Invalid flags set.";
|
||||
|
||||
return temINVALID_FLAG;
|
||||
}
|
||||
|
||||
return Transactor::preCheck ();
|
||||
}
|
||||
|
||||
TER doApply () override
|
||||
{
|
||||
if (mFeeDue == zero)
|
||||
{
|
||||
mTxnAccount->setFlag (lsfPasswordSpent);
|
||||
}
|
||||
|
||||
if (mTxn.isFieldPresent (sfRegularKey))
|
||||
{
|
||||
Account uAuthKeyID = mTxn.getFieldAccount160 (sfRegularKey);
|
||||
mTxnAccount->setFieldAccount (sfRegularKey, uAuthKeyID);
|
||||
mTxnAccount->setFieldAccount (sfRegularKey,
|
||||
mTxn.getFieldAccount160 (sfRegularKey));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user