Remove recursiveness of reserve_add and reserve_remove. This allows compiler optimizations
and avoids the remote possibility of a double failure which breaks atomicity.
eg. Imagine I call reserve_add for a path of 4 elements and I was promised I was atomic (either the changes succeed or no changes are applied). Then it fails at the 3rd step, then reserve_add calls reserve_remove to unwind the changed and
we don't check the success of that call. If that call to reserve_remove fails, then the promise of atomicity is broken.
Related Issues
Changes Made
[ ] Feature: Brief description of the new feature or functionality added.
[ ] Bug Fix: Brief description of the bug fixed and how it was resolved.
[x] Refactor: Just remove a recursive function call.
Checklist
Ensure the following tasks are completed before submitting the PR:
[x] Changelog has been added in relevant commit/s.
[x] Tests have been added or updated to cover the changes.
[x] Documentation has been updated as needed.
[x] Any relevant comments or TODOs have been addressed or removed.
Askrene refactor
Description
Remove recursiveness of
reserve_add
and reserve_remove. This allows compiler optimizations and avoids the remote possibility of a double failure which breaks atomicity.eg. Imagine I call
reserve_add
for a path of 4 elements and I was promised I was atomic (either the changes succeed or no changes are applied). Then it fails at the 3rd step, thenreserve_add
callsreserve_remove
to unwind the changed and we don't check the success of that call. If that call toreserve_remove
fails, then the promise of atomicity is broken.Related Issues
Changes Made
Checklist
Ensure the following tasks are completed before submitting the PR:
TODOs
have been addressed or removed.Additional Notes