mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-02 17:06:00 +00:00
disallow a computation allowance of 0 (#5541)
This commit is contained in:
@@ -1970,6 +1970,13 @@ struct Escrow_test : public beast::unit_test::suite
|
|||||||
ter(tefWASM_FIELD_NOT_INCLUDED));
|
ter(tefWASM_FIELD_NOT_INCLUDED));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// ComputationAllowance value of 0
|
||||||
|
env(escrow::finish(carol, alice, seq),
|
||||||
|
escrow::comp_allowance(0),
|
||||||
|
ter(temBAD_LIMIT));
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// not enough fees
|
// not enough fees
|
||||||
// This function takes 4 gas
|
// This function takes 4 gas
|
||||||
|
|||||||
@@ -743,6 +743,10 @@ EscrowFinish::preflight(PreflightContext const& ctx)
|
|||||||
|
|
||||||
if (auto const allowance = ctx.tx[~sfComputationAllowance]; allowance)
|
if (auto const allowance = ctx.tx[~sfComputationAllowance]; allowance)
|
||||||
{
|
{
|
||||||
|
if (*allowance == 0)
|
||||||
|
{
|
||||||
|
return temBAD_LIMIT;
|
||||||
|
}
|
||||||
if (*allowance > ctx.app.config().FEES.extension_compute_limit)
|
if (*allowance > ctx.app.config().FEES.extension_compute_limit)
|
||||||
{
|
{
|
||||||
JLOG(ctx.j.debug())
|
JLOG(ctx.j.debug())
|
||||||
|
|||||||
Reference in New Issue
Block a user