aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-06-10 23:22:43 +0800
committerMaran <maran.hidskes@gmail.com>2014-06-10 23:22:43 +0800
commit69044fe5774840a49de3f881a490db52e907affb (patch)
tree88f44d5e3463822131ef50d717070cbc74af8053
parent753f749423df7d5fba55a4080383d215db8e0fc7 (diff)
downloadgo-tangerine-69044fe5774840a49de3f881a490db52e907affb.tar
go-tangerine-69044fe5774840a49de3f881a490db52e907affb.tar.gz
go-tangerine-69044fe5774840a49de3f881a490db52e907affb.tar.bz2
go-tangerine-69044fe5774840a49de3f881a490db52e907affb.tar.lz
go-tangerine-69044fe5774840a49de3f881a490db52e907affb.tar.xz
go-tangerine-69044fe5774840a49de3f881a490db52e907affb.tar.zst
go-tangerine-69044fe5774840a49de3f881a490db52e907affb.zip
Refactor to use new method
-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 b45d254b5..5e6ce46e1 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