aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbojie <bojie@dexon.org>2019-01-29 06:31:01 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitbb92964ba3a28f595bb608d7bb4b5ed116a25360 (patch)
tree86cb09342303368cf85bdf5583b56750a57b9775
parentde4a35d14aa724a2d29f67e6618e81e1a7a4f6e9 (diff)
downloaddexon-bb92964ba3a28f595bb608d7bb4b5ed116a25360.tar.gz
dexon-bb92964ba3a28f595bb608d7bb4b5ed116a25360.tar.zst
dexon-bb92964ba3a28f595bb608d7bb4b5ed116a25360.zip
app: prepare/verify block limit in correct round (#181)
-rw-r--r--dex/app.go4
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 {