fix bug in function GetBlockCumulativeGas (#663)

This commit is contained in:
Pierre 2020-12-16 18:58:25 +08:00 committed by GitHub
parent cb96bc4ea3
commit 1d084423a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,7 +201,7 @@ func GetBlockCumulativeGas(cdc *codec.Codec, block *tmtypes.Block, idx int) uint
var gasUsed uint64 var gasUsed uint64
txDecoder := evmtypes.TxDecoder(cdc) txDecoder := evmtypes.TxDecoder(cdc)
for i := 0; i < idx && i < len(block.Txs[i]); i++ { for i := 0; i < idx && i < len(block.Txs); i++ {
txi, err := txDecoder(block.Txs[i]) txi, err := txDecoder(block.Txs[i])
if err != nil { if err != nil {
continue continue