File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,8 @@ func (f *FilterMaps) Start() {
241
241
log .Error ("Could not load head filter map snapshot" , "error" , err )
242
242
}
243
243
}
244
- f .closeWg .Add (1 )
244
+ f .closeWg .Add (2 )
245
+ go f .removeBloomBits ()
245
246
go f .indexerLoop ()
246
247
}
247
248
@@ -334,6 +335,13 @@ func (f *FilterMaps) init() error {
334
335
return batch .Write ()
335
336
}
336
337
338
+ // removeBloomBits removes old bloom bits data from the database.
339
+ func (f * FilterMaps ) removeBloomBits () {
340
+ f .removeDbWithPrefix (rawdb .BloomBitsPrefix , "Removing old bloom bits database" )
341
+ f .removeDbWithPrefix (rawdb .BloomBitsIndexPrefix , "Removing old bloom bits chain index" )
342
+ f .closeWg .Done ()
343
+ }
344
+
337
345
// removeDbWithPrefix removes data with the given prefix from the database and
338
346
// returns true if everything was successfully removed.
339
347
func (f * FilterMaps ) removeDbWithPrefix (prefix []byte , action string ) bool {
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ var (
106
106
blockReceiptsPrefix = []byte ("r" ) // blockReceiptsPrefix + num (uint64 big endian) + hash -> block receipts
107
107
108
108
txLookupPrefix = []byte ("l" ) // txLookupPrefix + hash -> transaction/receipt lookup metadata
109
- bloomBitsPrefix = []byte ("B" ) // bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash -> bloom bits
109
+ BloomBitsPrefix = []byte ("B" ) // BloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash -> bloom bits
110
110
SnapshotAccountPrefix = []byte ("a" ) // SnapshotAccountPrefix + account hash -> account trie value
111
111
SnapshotStoragePrefix = []byte ("o" ) // SnapshotStoragePrefix + account hash + storage hash -> storage trie value
112
112
CodePrefix = []byte ("c" ) // CodePrefix + code hash -> account code
You can’t perform that action at this time.
0 commit comments