aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorbojie <bojie@dexon.org>2019-01-29 06:31:01 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:22 +0800
commit24e33c2376ea46b5029b745bd4839e54499b1bd8 (patch)
tree9461307a4782b41f6f418478c5ac252da98719fb /dex
parentc3fede5add8b5b926f613241208a1cf9b0696874 (diff)
downloadgo-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.tar
go-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.tar.gz
go-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.tar.bz2
go-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.tar.lz
go-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.tar.xz
go-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.tar.zst
go-tangerine-24e33c2376ea46b5029b745bd4839e54499b1bd8.zip
app: prepare/verify block limit in correct round (#181)
Diffstat (limited to 'dex')
-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 {