aboutsummaryrefslogtreecommitdiffstats
path: root/dagger.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-13 08:22:33 +0800
committerobscuren <geffobscura@gmail.com>2014-01-13 08:22:33 +0800
commit578b63e2b8a32122fb45f9f053503e51d9a5c535 (patch)
tree156f31a7b3fccb30a575128f28fb1034283ef054 /dagger.go
parent7ade1778fba0fd1f6e0bccc7647cd8fb3185528d (diff)
downloaddexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.tar
dexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.tar.gz
dexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.tar.bz2
dexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.tar.lz
dexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.tar.xz
dexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.tar.zst
dexon-578b63e2b8a32122fb45f9f053503e51d9a5c535.zip
Some miner reports
Diffstat (limited to 'dagger.go')
-rw-r--r--dagger.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/dagger.go b/dagger.go
index 70b0b4692..0cc63ea94 100644
--- a/dagger.go
+++ b/dagger.go
@@ -7,6 +7,7 @@ import (
"math/big"
"math/rand"
"time"
+ "log"
)
type Dagger struct {
@@ -22,7 +23,9 @@ func (dag *Dagger) Find(obj *big.Int, resChan chan int64) {
for i := 0; i < 1000; i++ {
rnd := r.Int63()
- if dag.Eval(big.NewInt(rnd)).Cmp(obj) < 0 {
+ res := dag.Eval(big.NewInt(rnd))
+ log.Printf("rnd %v\nres %v\nobj %v\n", rnd, res, obj)
+ if res.Cmp(obj) < 0 {
// Post back result on the channel
resChan <- rnd
// Notify other threads we've found a valid nonce
@@ -119,7 +122,7 @@ func Sum(sha hash.Hash) []byte {
func (dag *Dagger) Eval(N *big.Int) *big.Int {
pow := ethutil.BigPow(2, 26)
- dag.xn = N.Div(N, pow)
+ dag.xn = pow.Div(N, pow)
sha := sha3.NewKeccak256()
sha.Reset()