Skip to content
Snippets Groups Projects

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

1 file
+ 2
7
Compare changes
  • Side-by-side
  • Inline
@@ -329,19 +329,14 @@ export class LevelDBSindex extends LevelDBTable<SindexEntry>
}
}
/**
* Duplicate with trimConditions?!
* @param writtenOn
* @param id
*/
private async trimWrittenOn(writtenOn: number, id: string) {
const k = LevelDBSindex.trimWrittenOnKey(writtenOn);
const existing = await this.getWrittenOnSourceIds(writtenOn);
const trimmed = arrayPruneAllCopy(existing, id);
if (trimmed.length) {
await this.indexForConditions.put(k, trimmed);
await this.indexForTrimming.put(k, trimmed);
} else {
await this.indexForConditions.del(k);
await this.indexForTrimming.del(k);
}
}
Loading