mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
Make mempool fail txs with negative gas wanted (#2994)
This is only one part of #2989. We also need to fix the application, and add rules to consensus to ensure this.
This commit is contained in:
parent
41eaf0e31d
commit
d5d0d2bd77
@ -108,6 +108,10 @@ func PostCheckMaxGas(maxGas int64) PostCheckFunc {
|
|||||||
if maxGas == -1 {
|
if maxGas == -1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if res.GasWanted < 0 {
|
||||||
|
return fmt.Errorf("gas wanted %d is negative",
|
||||||
|
res.GasWanted)
|
||||||
|
}
|
||||||
if res.GasWanted > maxGas {
|
if res.GasWanted > maxGas {
|
||||||
return fmt.Errorf("gas wanted %d is greater than max gas %d",
|
return fmt.Errorf("gas wanted %d is greater than max gas %d",
|
||||||
res.GasWanted, maxGas)
|
res.GasWanted, maxGas)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user