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:
f831384
)
fix calDiff bug due to we set the genesis block height to 1 instead of 0
author
paladz
<453256728@qq.com>
Thu, 2 Nov 2017 04:36:10 +0000
(12:36 +0800)
committer
paladz
<453256728@qq.com>
Thu, 2 Nov 2017 04:36:10 +0000
(12:36 +0800)
consensus/difficulty.go
patch
|
blob
|
history
diff --git
a/consensus/difficulty.go
b/consensus/difficulty.go
index
86e21fd
..
d2bd72b
100644
(file)
--- a/
consensus/difficulty.go
+++ b/
consensus/difficulty.go
@@
-88,7
+88,7
@@
func CheckProofOfWork(hash *bc.Hash, bits uint64) bool {
func CalcNextRequiredDifficulty(lastBH, compareBH *legacy.BlockHeader) uint64 {
if lastBH == nil {
return powMinBits
- } else if (lastBH.Height
+1
)%BlocksPerRetarget != 0 {
+ } else if (lastBH.Height)%BlocksPerRetarget != 0 {
return lastBH.Bits
}