OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ad4785
)
checkProofOfWork
author
jeason
<jeason_ustc@.com>
Tue, 1 Aug 2017 08:23:45 +0000
(
01:23
-0700)
committer
jeason
<jeason_ustc@.com>
Tue, 1 Aug 2017 08:23:45 +0000
(
01:23
-0700)
rpc/core/generate.go
patch
|
blob
|
history
diff --git
a/rpc/core/generate.go
b/rpc/core/generate.go
index
3210db5
..
2579e23
100644
(file)
--- a/
rpc/core/generate.go
+++ b/
rpc/core/generate.go
@@
-64,3
+64,11
@@
func solveBlock(header *wire.BlockHeader, targetDifficulty *big.Int) bool {
return false
}
+
+func checkProofOfWork(header *wire.BlockHeader, targetDifficulty *big.Int) bool {
+ hash := hdr.BlockHash()
+ if wire.HashToBig(&hash).Cmp(targetDifficulty) <= 0 {
+ return true
+ }
+}
+