aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbojie <bojie@dexon.org>2019-01-29 06:31:01 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:02 +0800
commit3dc14f9618cfe1a1a888028bf4982ab725160615 (patch)
treea1e951ca344161c584c42088365812e0cdea713c
parent04b0443d98bc36d9b3428f4831972b93357d46ae (diff)
downloaddexon-3dc14f9618cfe1a1a888028bf4982ab725160615.tar.gz
dexon-3dc14f9618cfe1a1a888028bf4982ab725160615.tar.zst
dexon-3dc14f9618cfe1a1a888028bf4982ab725160615.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 {