Skip to content
Snippets Groups Projects
Commit 3ba60c15 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

fix(1447): Reverting a block should update LevelDBSindex.indexForTrimming (and...

fix(1447): Reverting a block should update LevelDBSindex.indexForTrimming (and not indexForConditions) - close #1447
parent fe5958ad
No related branches found
No related tags found
1 merge request!1434fix(1447): Reverting a block should update LevelDBSindex.indexForTrimming (and...
Pipeline #32219 failed
...@@ -329,19 +329,14 @@ export class LevelDBSindex extends LevelDBTable<SindexEntry> ...@@ -329,19 +329,14 @@ export class LevelDBSindex extends LevelDBTable<SindexEntry>
} }
} }
/**
* Duplicate with trimConditions?!
* @param writtenOn
* @param id
*/
private async trimWrittenOn(writtenOn: number, id: string) { private async trimWrittenOn(writtenOn: number, id: string) {
const k = LevelDBSindex.trimWrittenOnKey(writtenOn); const k = LevelDBSindex.trimWrittenOnKey(writtenOn);
const existing = await this.getWrittenOnSourceIds(writtenOn); const existing = await this.getWrittenOnSourceIds(writtenOn);
const trimmed = arrayPruneAllCopy(existing, id); const trimmed = arrayPruneAllCopy(existing, id);
if (trimmed.length) { if (trimmed.length) {
await this.indexForConditions.put(k, trimmed); await this.indexForTrimming.put(k, trimmed);
} else { } else {
await this.indexForConditions.del(k); await this.indexForTrimming.del(k);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment