fix: fast node can not recover from force kill or panic (#1014)

This commit is contained in:
zjubfd 2022-07-25 21:12:45 +08:00 committed by GitHub
parent 9d59a140d6
commit 0ed265c5e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -258,6 +258,9 @@ func (bc *BlockChain) GetTd(hash common.Hash, number uint64) *big.Int {
// HasState checks if state trie is fully present in the database or not.
func (bc *BlockChain) HasState(hash common.Hash) bool {
if bc.stateCache.NoTries() {
return bc.snaps != nil && bc.snaps.Snapshot(hash) != nil
}
if bc.pipeCommit && bc.snaps != nil {
// If parent snap is pending on verification, treat it as state exist
if s := bc.snaps.Snapshot(hash); s != nil && !s.Verified() {