aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-06-11 22:16:57 +0800
committerMaran <maran.hidskes@gmail.com>2014-06-11 22:16:57 +0800
commit1938bfcddfd2722880a692c59cad344b611711c8 (patch)
tree8a3489470cf2fa8823d813733f57cefa9490080a /ethchain/block.go
parent71ab5d52b692a42cc3af034e5ff1aab5b4b6477d (diff)
downloaddexon-1938bfcddfd2722880a692c59cad344b611711c8.tar
dexon-1938bfcddfd2722880a692c59cad344b611711c8.tar.gz
dexon-1938bfcddfd2722880a692c59cad344b611711c8.tar.bz2
dexon-1938bfcddfd2722880a692c59cad344b611711c8.tar.lz
dexon-1938bfcddfd2722880a692c59cad344b611711c8.tar.xz
dexon-1938bfcddfd2722880a692c59cad344b611711c8.tar.zst
dexon-1938bfcddfd2722880a692c59cad344b611711c8.zip
Fix compare
Diffstat (limited to 'ethchain/block.go')
-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())