default infinite block gas meter

This commit is contained in:
rigelrozanski 2018-11-13 14:30:24 -05:00
parent 3bf67b63e1
commit 8069b2b7e6
1 changed files with 9 additions and 2 deletions

View File

@ -435,8 +435,15 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
WithBlockHeader(req.Header).
WithBlockHeight(req.Header.Height)
}
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewGasMeter(app.maximumBlockGas))
// add block gas meter
if app.maximumBlockGas > 0 {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewGasMeter(app.maximumBlockGas))
} else {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewInfiniteGasMeter())
}
if app.beginBlocker != nil {
res = app.beginBlocker(app.deliverState.ctx, req)