Integrate rollback into withdrawal algorithm

This integrates the rollback last output into the actual withdrawal algorithm.

All tests passes - but I still need to add a test that triggers these conditions which will be next.