OSDN Git Service

add checkProofOfWork
authorjeason <jeason_ustc@.com>
Tue, 1 Aug 2017 08:28:09 +0000 (01:28 -0700)
committerjeason <jeason_ustc@.com>
Tue, 1 Aug 2017 08:28:09 +0000 (01:28 -0700)
rpc/core/generate.go

index 2579e23..66c11bf 100644 (file)
@@ -66,9 +66,9 @@ func solveBlock(header *wire.BlockHeader, targetDifficulty *big.Int) bool {
 }
 
 func checkProofOfWork(header *wire.BlockHeader, targetDifficulty *big.Int) bool {
-     hash := hdr.BlockHash()
+     hash := header.BlockHash()
      if wire.HashToBig(&hash).Cmp(targetDifficulty) <= 0 {
              return true
      }
+     return false
 }
-