|
|
@ -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()) |
|
|
|