mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
added deletion support (#4451)
This commit is contained in:
parent
7f81e0ddde
commit
cad32ee1cf
@ -289,6 +289,20 @@ func (m *memorymutation) Flush(tx kv.RwTx) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Obliterate buckets who are to be deleted
|
||||
for bucket := range m.clearedTables {
|
||||
if err := tx.ClearBucket(bucket); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// Obliterate entries who are to be deleted
|
||||
for bucket, keys := range m.deletedEntries {
|
||||
for key := range keys {
|
||||
if err := tx.Delete(bucket, []byte(key), nil); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
// Iterate over each bucket and apply changes accordingly.
|
||||
for _, bucket := range buckets {
|
||||
if _, ok := m.dupsortTables[bucket]; ok && bucket != kv.HashedStorage {
|
||||
|
Loading…
Reference in New Issue
Block a user