From c6d62dfa7d588072dc649e83592fa1fc11c55bd4 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 4 Mar 2019 22:25:01 +0000 Subject: [PATCH] baseapp: allow for infinite gas when maxGas < 0 Closes: #3791 --- PENDING.md | 1 + baseapp/baseapp.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/PENDING.md b/PENDING.md index 49b2eeb8b439..49b3de619cff 100644 --- a/PENDING.md +++ b/PENDING.md @@ -114,5 +114,6 @@ truncation of undelegation tokens. * [\#3717] Ignore unknown proposers in allocating rewards for proposers, in case unbonding period was just 1 block and proposer was already deleted. * [\#3726] Cap(clip) reward to remaining coins in AllocateTokens. +* [\#3791] baseapp: allow for infinite gas when maxGas < 0 ### Tendermint diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index b6694a503209..5aea59fee836 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -289,7 +289,8 @@ func (app *BaseApp) storeConsensusParams(consensusParams *abci.ConsensusParams) // getMaximumBlockGas gets the maximum gas from the consensus params. func (app *BaseApp) getMaximumBlockGas() (maxGas uint64) { - if app.consensusParams == nil || app.consensusParams.BlockSize == nil { + if app.consensusParams == nil || app.consensusParams.BlockSize == nil || + app.consensusParams.BlockSize.MaxGas <= 0 { return 0 } return uint64(app.consensusParams.BlockSize.MaxGas)