trie: check nil bloom (#1039)

This commit is contained in:
Daniel Liu 2025-05-20 15:13:34 +08:00 committed by GitHub
parent 1472f3b1eb
commit b94b29b8d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -156,7 +156,7 @@ func (s *Sync) AddCodeEntry(hash common.Hash, depth int, parent common.Hash) {
if s.membatch.hasCode(hash) {
return
}
if s.bloom.Contains(hash[:]) {
if s.bloom == nil || s.bloom.Contains(hash[:]) {
// Bloom filter says this might be a duplicate, double check.
// If database says yes, the blob is present for sure.
// Note we only check the existence with new code scheme, fast