Reverting a block will never trim LevelDBSindex.indexForTrimming
In LevelDBSindex.removeBlock()
the function trimWrittenOn()
is supposed to clean entries of the index indexForTrimming
but instead indexForConditions is used :
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.indexForConditionsput(k, trimmed); // <= SHOULD BE indexForTrimming
} else {
await this.indexForConditions.del(k); // <= SHOULD BE indexForTrimming
}
}