mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 14:20:56 +00:00
fix: Check transaction type before RawTransactions
This commit is contained in:
committed by
Ayaz Salikhov
parent
6b3eaf091b
commit
faca302adf
@@ -812,16 +812,19 @@ invalidMPTAmountInTx(STObject const& tx)
|
||||
static bool
|
||||
isBatchRawTransactionOkay(STTx const& tx, std::string& reason)
|
||||
{
|
||||
if (!tx.isFieldPresent(sfRawTransactions))
|
||||
XRPL_ASSERT(
|
||||
tx.getTxnType() == ttBATCH || !tx.isFieldPresent(sfRawTransactions),
|
||||
"xrpl::isBatchRawTransactionOkay : raw transactions only on batch");
|
||||
|
||||
if (tx.getTxnType() != ttBATCH)
|
||||
return true;
|
||||
|
||||
// sfRawTransactions only appears on a Batch. passesLocalChecks runs on
|
||||
// unverified user and peer input, so reject (rather than assert) a non-batch
|
||||
// transaction that carries it.
|
||||
if (tx.getTxnType() != ttBATCH)
|
||||
if (!tx.isFieldPresent(sfRawTransactions))
|
||||
{
|
||||
reason = "Only Batch transactions may contain raw transactions.";
|
||||
// LCOV_EXCL_START
|
||||
reason = "Batch transactions must contain raw transactions.";
|
||||
return false;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
if (tx.isFieldPresent(sfBatchSigners) &&
|
||||
|
||||
Reference in New Issue
Block a user