aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/ethchain/block.go b/ethchain/block.go
index 780c60869..fee4a2d59 100644
--- a/ethchain/block.go
+++ b/ethchain/block.go
@@ -155,9 +155,10 @@ func (block *Block) PayFee(addr []byte, fee *big.Int) bool {
}
func (block *Block) CalcGasLimit(parent *Block) *big.Int {
- if block.Number == big.NewInt(0) {
+ if block.Number.Cmp(big.NewInt(0)) == 0 {
return ethutil.BigPow(10, 6)
}
+
previous := new(big.Int).Mul(big.NewInt(1023), parent.GasLimit)
current := new(big.Rat).Mul(new(big.Rat).SetInt(block.GasUsed), big.NewRat(6, 5))
curInt := new(big.Int).Div(current.Num(), current.Denom())