Skip to content

Commit

Permalink
Fix fastsync require block 0 err
Browse files Browse the repository at this point in the history
  • Loading branch information
yahtoo committed Aug 30, 2018
1 parent 5896a30 commit 2487629
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions netsync/block_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2487629

Please sign in to comment.