Merge branch 'develop' into miner
This commit is contained in:
@ -6,4 +6,5 @@ type Block interface {
|
||||
Difficulty() *big.Int
|
||||
HashNoNonce() []byte
|
||||
N() []byte
|
||||
Number() *big.Int
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ func (pow *EasyPow) Search(block pow.Block, stop <-chan struct{}) []byte {
|
||||
elapsed := time.Now().UnixNano() - start
|
||||
hashes := ((float64(1e9) / float64(elapsed)) * float64(i)) / 1000
|
||||
pow.HashRate = int64(hashes)
|
||||
//powlogger.Infoln("Hashing @", pow.HashRate, "khash")
|
||||
|
||||
t = time.Now()
|
||||
}
|
||||
@ -83,7 +82,7 @@ func verify(hash []byte, diff *big.Int, nonce []byte) bool {
|
||||
sha.Write(d)
|
||||
|
||||
verification := new(big.Int).Div(ethutil.BigPow(2, 256), diff)
|
||||
res := ethutil.U256(ethutil.BigD(sha.Sum(nil)))
|
||||
res := ethutil.BigD(sha.Sum(nil))
|
||||
|
||||
return res.Cmp(verification) <= 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user