forked from TrueCloudLab/neoneo-go
core: drop another useless genesis-specific header handling branch
If we only have genesis block (or <2000 headers) then we might as well use generic logic below with zero targetHash because genesis block has zero PrevHash (and its hash will naturally be the last on the chain going backwards).
This commit is contained in:
parent
83e2ca054f
commit
16db4746cc
1 changed files with 0 additions and 7 deletions
|
@ -434,13 +434,6 @@ func (bc *Blockchain) init() error {
|
||||||
var targetHash util.Uint256
|
var targetHash util.Uint256
|
||||||
if len(bc.headerHashes) > 0 {
|
if len(bc.headerHashes) > 0 {
|
||||||
targetHash = bc.headerHashes[len(bc.headerHashes)-1]
|
targetHash = bc.headerHashes[len(bc.headerHashes)-1]
|
||||||
} else {
|
|
||||||
genesisBlock, err := CreateGenesisBlock(bc.config)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
targetHash = genesisBlock.Hash()
|
|
||||||
bc.headerHashes = append(bc.headerHashes, targetHash)
|
|
||||||
}
|
}
|
||||||
headers := make([]util.Uint256, 0, headerBatchCount)
|
headers := make([]util.Uint256, 0, headerBatchCount)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue