aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block_chain.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-12 03:56:59 +0800
committerobscuren <geffobscura@gmail.com>2014-06-12 03:56:59 +0800
commit8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1 (patch)
tree3cf67a559ef450500ddfd7df9d457f3e1a994caf /ethchain/block_chain.go
parent9ee6295c752a518603de01e4feaec787c61a5dcf (diff)
parent1938bfcddfd2722880a692c59cad344b611711c8 (diff)
downloaddexon-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.tar.gz
dexon-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.tar.zst
dexon-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.zip
Merge branch 'develop' into interop
Conflicts: peer.go
Diffstat (limited to 'ethchain/block_chain.go')
-rw-r--r--ethchain/block_chain.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/ethchain/block_chain.go b/ethchain/block_chain.go
index 68ef9d47e..8cede2403 100644
--- a/ethchain/block_chain.go
+++ b/ethchain/block_chain.go
@@ -72,19 +72,7 @@ func (bc *BlockChain) NewBlock(coinbase []byte) *Block {
block.Number = new(big.Int).Add(bc.CurrentBlock.Number, ethutil.Big1)
- // max(10000, (parent gas limit * (1024 - 1) + (parent gas used * 6 / 5)) / 1024)
- base := new(big.Int)
- base2 := new(big.Int)
- parentGL := bc.CurrentBlock.GasLimit
- parentUsed := bc.CurrentBlock.GasUsed
-
- base.Mul(parentGL, big.NewInt(1024-1))
- base2.Mul(parentUsed, big.NewInt(6))
- base2.Div(base2, big.NewInt(5))
- base.Add(base, base2)
- base.Div(base, big.NewInt(1024))
-
- block.GasLimit = ethutil.BigMax(big.NewInt(10000), base)
+ block.GasLimit = block.CalcGasLimit(bc.CurrentBlock)
}
return block