Merge pull request #4 from denispeplin/patch-1
Don't output every hash onto console, its too slow
This commit is contained in:
commit
c5c21fd069
|
@ -56,7 +56,9 @@ func (pow *ProofOfWork) Run() (int, []byte) {
|
||||||
data := pow.prepareData(nonce)
|
data := pow.prepareData(nonce)
|
||||||
|
|
||||||
hash = sha256.Sum256(data)
|
hash = sha256.Sum256(data)
|
||||||
fmt.Printf("\r%x", hash)
|
if math.Remainder(float64(nonce), 100000) == 0 {
|
||||||
|
fmt.Printf("\r%x", hash)
|
||||||
|
}
|
||||||
hashInt.SetBytes(hash[:])
|
hashInt.SetBytes(hash[:])
|
||||||
|
|
||||||
if hashInt.Cmp(pow.target) == -1 {
|
if hashInt.Cmp(pow.target) == -1 {
|
||||||
|
|
Loading…
Reference in New Issue