When we encounter a job that has no valid blocks (e.g., because they were deleted by the truncation logic) we currently remove it from the in-memory store but not from bolt DB. This causes a burst of new (invalid) jobs every time we restore from a snapshot.
This change ensures that such jobs are removed. There are a few other (mostly cosmetic) changes as well.
When we encounter a job that has no valid blocks (e.g., because they were deleted by the truncation logic) we currently remove it from the in-memory store but not from bolt DB. This causes a burst of new (invalid) jobs every time we restore from a snapshot.
This change ensures that such jobs are removed. There are a few other (mostly cosmetic) changes as well.