Skip to content

Commit 915c614

Browse files
authored
Merge pull request #22332 from karalabe/fix-fastsync-restart-bloom-crash
trie: fix bloom crash on fast sync restart
2 parents f4fcd4f + e991bda commit 915c614

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎trie/sync.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,15 @@ func (s *Sync) Commit(dbw ethdb.Batch) error {
313313
// Dump the membatch into a database dbw
314314
for key, value := range s.membatch.nodes {
315315
rawdb.WriteTrieNode(dbw, key, value)
316-
s.bloom.Add(key[:])
316+
if s.bloom != nil {
317+
s.bloom.Add(key[:])
318+
}
317319
}
318320
for key, value := range s.membatch.codes {
319321
rawdb.WriteCode(dbw, key, value)
320-
s.bloom.Add(key[:])
322+
if s.bloom != nil {
323+
s.bloom.Add(key[:])
324+
}
321325
}
322326
// Drop the membatch data and return
323327
s.membatch = newSyncMemBatch()

0 commit comments

Comments
 (0)