core: fix bad parent hash when jumping to genesis in setHead (#23162)

This commit is contained in:
gary rong 2021-07-06 15:32:26 +08:00 committed by GitHub
parent 99169016d2
commit bd566977e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -574,7 +574,7 @@ func (hc *HeaderChain) SetHead(head uint64, updateFn UpdateHeadBlocksCallback, d
if parent == nil {
parent = hc.genesisHeader
}
parentHash = hdr.ParentHash
parentHash = parent.Hash()
// Notably, since geth has the possibility for setting the head to a low
// height which is even lower than ancient head.