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 @@ -233,7 +233,8 @@ func (f *FilterMaps) Start() {
233
233
log .Error ("Could not load head filter map snapshot" , "error" , err )
234
234
}
235
235
}
236
- f .closeWg .Add (1 )
236
+ f .closeWg .Add (2 )
237
+ go f .removeBloomBits ()
237
238
go f .indexerLoop ()
238
239
}
239
240
@@ -328,6 +329,13 @@ func (f *FilterMaps) init() error {
328
329
return batch .Write ()
329
330
}
330
331
332
+ // removeBloomBits removes old bloom bits data from the database.
333
+ func (f * FilterMaps ) removeBloomBits () {
334
+ f .removeDbWithPrefix (rawdb .BloomBitsPrefix , "Removing old bloom bits database" )
335
+ f .removeDbWithPrefix (rawdb .BloomBitsIndexPrefix , "Removing old bloom bits chain index" )
336
+ f .closeWg .Done ()
337
+ }
338
+
331
339
// removeDbWithPrefix removes data with the given prefix from the database and
332
340
// returns true if everything was successfully removed.
333
341
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