diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-04 00:20:34 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-04 00:20:34 +0800 |
commit | 22b132e28f74cabef38a55874da8e3db93786144 (patch) | |
tree | 2ae0e114e8aaf7dfba259c5e64979575bec4004b /pow/ezp | |
parent | ee0a1bec6c3ce942e51265535961ac6a745d33eb (diff) | |
parent | de9f79133faa1ff5dcd16fb4fd13d06b7799ded9 (diff) | |
download | dexon-22b132e28f74cabef38a55874da8e3db93786144.tar dexon-22b132e28f74cabef38a55874da8e3db93786144.tar.gz dexon-22b132e28f74cabef38a55874da8e3db93786144.tar.bz2 dexon-22b132e28f74cabef38a55874da8e3db93786144.tar.lz dexon-22b132e28f74cabef38a55874da8e3db93786144.tar.xz dexon-22b132e28f74cabef38a55874da8e3db93786144.tar.zst dexon-22b132e28f74cabef38a55874da8e3db93786144.zip |
Merge branch 'publictests' of https://github.com/xcthulhu/go-ethereum into xcthulhu-publictests
Diffstat (limited to 'pow/ezp')
-rw-r--r-- | pow/ezp/pow.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pow/ezp/pow.go b/pow/ezp/pow.go index 540381243..49854c3d0 100644 --- a/pow/ezp/pow.go +++ b/pow/ezp/pow.go @@ -32,7 +32,7 @@ func (pow *EasyPow) Turbo(on bool) { pow.turbo = on } -func (pow *EasyPow) Search(block pow.Block, stop <-chan struct{}) []byte { +func (pow *EasyPow) Search(block pow.Block, stop <-chan struct{}) ([]byte, []byte, []byte) { r := rand.New(rand.NewSource(time.Now().UnixNano())) hash := block.HashNoNonce() diff := block.Difficulty() @@ -57,7 +57,7 @@ empty: for { select { case <-stop: - return nil + return nil, nil, nil default: i++ @@ -67,7 +67,7 @@ empty: sha := crypto.Sha3(big.NewInt(r.Int63()).Bytes()) if verify(hash, diff, sha) { - return sha + return sha, nil, nil } } @@ -75,8 +75,6 @@ empty: time.Sleep(20 * time.Microsecond) } } - - return nil } func (pow *EasyPow) Verify(block pow.Block) bool { @@ -96,5 +94,5 @@ func verify(hash []byte, diff *big.Int, nonce []byte) bool { } func Verify(block pow.Block) bool { - return verify(block.HashNoNonce(), block.Difficulty(), block.N()) + return verify(block.HashNoNonce(), block.Difficulty(), block.Nonce()) } |