This PR adds coverage for our simulated network and (unsurprisingly) squashes some bugs:
Do not double-return liquidity for failed HTLCs: previously we'd return liquidity to local balance on failures twice over
Off by one removal: if a HTLC failed at index 0, we would not remove the first HTLC because our loop was not running for =0.
Removal bugs not caught in original testing because we evenly distribute liquidity, so didn't run into any payment failure - going to set liquidity to zero and re-run for a while to see if anything falls apart.
Thanks for the review @enigbe! Updated to address most feedback, left some of the test setup as-is for the sake of simplicity (can always come back and improve as is required).
This PR adds coverage for our simulated network and (unsurprisingly) squashes some bugs:
=0
.Removal bugs not caught in original testing because we evenly distribute liquidity, so didn't run into any payment failure - going to set liquidity to zero and re-run for a while to see if anything falls apart.