From bb92964ba3a28f595bb608d7bb4b5ed116a25360 Mon Sep 17 00:00:00 2001 From: bojie Date: Tue, 29 Jan 2019 06:31:01 +0800 Subject: app: prepare/verify block limit in correct round (#181) --- dex/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/app.go b/dex/app.go index e4fac8c7f..6739ebabb 100644 --- a/dex/app.go +++ b/dex/app.go @@ -219,7 +219,7 @@ func (d *DexconApp) preparePayload(ctx context.Context, position coreTypes.Posit chainID := new(big.Int).SetUint64(uint64(position.ChainID)) chainNums := new(big.Int).SetUint64(uint64(d.gov.GetNumChains(position.Round))) - blockGasLimit := new(big.Int).SetUint64(d.blockchain.CurrentBlock().GasLimit()) + blockGasLimit := new(big.Int).SetUint64(d.gov.DexconConfiguration(position.Round).BlockGasLimit) blockGasUsed := new(big.Int) allTxs := make([]*types.Transaction, 0, 3000) @@ -447,7 +447,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) coreTypes.BlockVerifySta } // Validate if balance is enough for TXs in this block. - blockGasLimit := new(big.Int).SetUint64(d.blockchain.CurrentBlock().GasLimit()) + blockGasLimit := new(big.Int).SetUint64(d.gov.DexconConfiguration(block.Position.Round).BlockGasLimit) blockGasUsed := new(big.Int) for _, tx := range transactions { -- cgit