|
|
@ -223,7 +223,8 @@ func (f *FilterMaps) Start() { |
|
|
|
log.Error("Could not load head filter map snapshot", "error", err) |
|
|
|
log.Error("Could not load head filter map snapshot", "error", err) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
f.closeWg.Add(1) |
|
|
|
f.closeWg.Add(2) |
|
|
|
|
|
|
|
go f.removeBloomBits() |
|
|
|
go f.indexerLoop() |
|
|
|
go f.indexerLoop() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -318,6 +319,13 @@ func (f *FilterMaps) init() error { |
|
|
|
return batch.Write() |
|
|
|
return batch.Write() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// removeBloomBits removes old bloom bits data from the database.
|
|
|
|
|
|
|
|
func (f *FilterMaps) removeBloomBits() { |
|
|
|
|
|
|
|
f.removeDbWithPrefix(rawdb.BloomBitsPrefix, "Removing old bloom bits database") |
|
|
|
|
|
|
|
f.removeDbWithPrefix(rawdb.BloomBitsIndexPrefix, "Removing old bloom bits chain index") |
|
|
|
|
|
|
|
f.closeWg.Done() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// removeDbWithPrefix removes data with the given prefix from the database and
|
|
|
|
// removeDbWithPrefix removes data with the given prefix from the database and
|
|
|
|
// returns true if everything was successfully removed.
|
|
|
|
// returns true if everything was successfully removed.
|
|
|
|
func (f *FilterMaps) removeDbWithPrefix(prefix []byte, action string) bool { |
|
|
|
func (f *FilterMaps) removeDbWithPrefix(prefix []byte, action string) bool { |
|
|
|