mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 18:45:55 +00:00
Improve pseudo-transaction handling (RIPD-1454, RIPD-1455):
Adds additional checks to prevent relaying and retrying pseudo-transactions.
This commit is contained in:
@@ -504,6 +504,11 @@ bool passesLocalChecks (STObject const& st, std::string& reason)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isPseudoTx(st))
|
||||
{
|
||||
reason = "Cannot submit pseudo transactions.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -516,4 +521,14 @@ sterilize (STTx const& stx)
|
||||
return std::make_shared<STTx const>(std::ref(sit));
|
||||
}
|
||||
|
||||
bool
|
||||
isPseudoTx(STObject const& tx)
|
||||
{
|
||||
auto t = tx[~sfTransactionType];
|
||||
if (!t)
|
||||
return false;
|
||||
auto tt = static_cast<TxType>(*t);
|
||||
return tt == ttAMENDMENT || tt == ttFEE;
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
Reference in New Issue
Block a user