Reverting a block that consumed a source can delete the source, in SINDEX sub-index (indexForConditions)

This unit test failed "revert b#3-4 and re-commit block#3 should be ok"

Cause:

  • In LevelDBSindex.removeBlock() (for reverting a block), we call trimConditions() when a consumption is undone (when the UPDATE record should be deleted) even if a source creation exists.

Solution:

  • The correct approach would be to call trimConditions() only when no source creation exists anymore.