fix(db): skip expired checkpoints for recovery by tomatoishealthy · Pull Request #5224 · tronprotocol/java-tron

What does this PR do?

The logic of checkpoint v2 prune is just deleting the directory if the checkpoint is expired, but the deletion is not an atomic operation and the expired checkpoints may be corrupted when kill -9 or machine shutdown, so we should skip the expired checkpoints when recovering.

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details