diff options
author | bojie <bojie@dexon.org> | 2019-01-29 06:31:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 06:31:01 +0800 |
commit | b2009e968d4cd02a06aae0f7cb7c3ac250bf7bdb (patch) | |
tree | c4dcacf09fd6b2f9edc964aa09ee1c2ffbbcb124 | |
parent | 8d9bd50502921f464ca44017c2d1e7ca0cc40c5d (diff) | |
download | dexon-b2009e968d4cd02a06aae0f7cb7c3ac250bf7bdb.tar.gz dexon-b2009e968d4cd02a06aae0f7cb7c3ac250bf7bdb.tar.zst dexon-b2009e968d4cd02a06aae0f7cb7c3ac250bf7bdb.zip |
app: prepare/verify block limit in correct round (#181)
-rw-r--r-- | dex/app.go | 4 |
1 files 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 { |