Integrate new ethash API and change geth makedag cmd

This commit is contained in:
Gustav Simonsson
2015-05-05 08:24:15 +02:00
parent 50659f4b48
commit b1cc9cdc74
9 changed files with 41 additions and 27 deletions

View File

@ -6,8 +6,8 @@ import (
"math/rand"
"time"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/logger"
)
@ -44,7 +44,7 @@ func (dag *Dagger) Find(obj *big.Int, resChan chan int64) {
resChan <- 0
}
func (dag *Dagger) Search(hash, diff *big.Int) ([]byte, []byte, []byte) {
func (dag *Dagger) Search(hash, diff *big.Int) (uint64, []byte) {
// TODO fix multi threading. Somehow it results in the wrong nonce
amountOfRoutines := 1
@ -69,7 +69,7 @@ func (dag *Dagger) Search(hash, diff *big.Int) ([]byte, []byte, []byte) {
}
}
return big.NewInt(res).Bytes(), nil, nil
return uint64(res), nil
}
func (dag *Dagger) Verify(hash, diff, nonce *big.Int) bool {