eth/protocols/snap, trie: better error-handling (#23657)

This commit is contained in:
Martin Holst Swende
2021-09-29 15:19:40 +02:00
committed by GitHub
parent 42bc1944a1
commit 3a6fe69f23
2 changed files with 5 additions and 5 deletions

View File

@ -469,7 +469,7 @@ func handleMessage(backend Backend, peer *Peer) error {
// Storage slots requested, open the storage trie and retrieve from there
account, err := snap.Account(common.BytesToHash(pathset[0]))
loads++ // always account database reads, even for failures
if err != nil {
if err != nil || account == nil {
break
}
stTrie, err := trie.NewSecure(common.BytesToHash(account.Root), triedb)