core: fix blockchain init with (2000*N + 1) header hashes in DB

Stored header count includes block number zero, so it's (height + 1).
This commit is contained in:
Roman Khimov 2019-11-29 14:22:31 +03:00
parent 2dfeb55d4c
commit 2c0ed62680

View file

@ -150,7 +150,7 @@ func (bc *Blockchain) init() error {
// There is a high chance that the Node is stopped before the next
// batch of 2000 headers was stored. Via the currentHeaders stored we can sync
// that with stored blocks.
if currHeaderHeight > bc.storedHeaderCount {
if currHeaderHeight >= bc.storedHeaderCount {
hash := currHeaderHash
var targetHash util.Uint256
if bc.headerList.Len() > 0 {