Commit 1938bfcd authored by Maran's avatar Maran

Fix compare

parent 71ab5d52
...@@ -155,9 +155,10 @@ func (block *Block) PayFee(addr []byte, fee *big.Int) bool { ...@@ -155,9 +155,10 @@ func (block *Block) PayFee(addr []byte, fee *big.Int) bool {
} }
func (block *Block) CalcGasLimit(parent *Block) *big.Int { 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) return ethutil.BigPow(10, 6)
} }
previous := new(big.Int).Mul(big.NewInt(1023), parent.GasLimit) 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)) current := new(big.Rat).Mul(new(big.Rat).SetInt(block.GasUsed), big.NewRat(6, 5))
curInt := new(big.Int).Div(current.Num(), current.Denom()) curInt := new(big.Int).Div(current.Num(), current.Denom())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment