diff options
author | Matthew Wampler-Doty <matthew.wampler.doty@gmail.com> | 2015-03-01 03:58:37 +0800 |
---|---|---|
committer | Matthew Wampler-Doty <matthew.wampler.doty@gmail.com> | 2015-03-03 11:29:34 +0800 |
commit | de9f79133faa1ff5dcd16fb4fd13d06b7799ded9 (patch) | |
tree | fcc9001d6b681ccdd1b3bbe516e3611e808341d7 /pow/ezp | |
parent | 080823bdeebbab2bcffdaefad703896700ed2c30 (diff) | |
download | dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.gz dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.bz2 dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.lz dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.xz dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.zst dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.zip |
Introducing ethash
Diffstat (limited to 'pow/ezp')
-rw-r--r-- | pow/ezp/pow.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pow/ezp/pow.go b/pow/ezp/pow.go index 8808d7ce0..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 { |