OSDN Git Service
(root)
/
bytom
/
bytom-spv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5896a30
)
Fix fastsync require block 0 err
v1.0.5-alpha
author
Yahtoo Ma
<yahtoo.ma@gmail.com>
Thu, 30 Aug 2018 11:02:27 +0000
(19:02 +0800)
committer
Yahtoo Ma
<yahtoo.ma@gmail.com>
Thu, 30 Aug 2018 11:02:27 +0000
(19:02 +0800)
netsync/block_keeper.go
patch
|
blob
|
history
diff --git
a/netsync/block_keeper.go
b/netsync/block_keeper.go
index
5d14091
..
d06348c
100644
(file)
--- a/
netsync/block_keeper.go
+++ b/
netsync/block_keeper.go
@@
-162,6
+162,9
@@
func (bk *blockKeeper) fastBlockSync(checkPoint *consensus.Checkpoint) error {
fastHeader := bk.headerList.Front()
for bk.chain.BestBlockHeight() <= checkPoint.Height {
+ if bk.chain.BestBlockHeight() == 0 {
+ fastHeader = fastHeader.Next()
+ }
hash := fastHeader.Value.(*types.BlockHeader).Hash()
merkleBlock, err := bk.requireMerkleBlock(fastHeader.Value.(*types.BlockHeader).Height, &hash)
if err != nil {