flowchart LR
n1((Node 1))
n2((Node 2))
n3((Node 3))
n1 --> |channel 1|n2
n2 --> |channel 2|n3
Each channel should have 100,000sats put in by node 1 for channel 1 and node 2 for channel 2
- n1 to n3 ample liquidity try to move 50,000 sats
- n1 to n3 not enough liquidity now try to move 60,000 sats reset state my sending back 50,000 sats from n3
- n1 to n3 ample liquidity generate invoice for 50,000 sats from n3
- n1 to n3 not enough liquidity generate bolt 11 invoice for 60,000 sats from n3 reset state using a keysend back from n3 to n1 of 50,000 sats
- generate a bolt 12 invoice from n3 pay 10,000 sats to bolt 12 invoice from n1 and n2 perform a refund transaction for both the pays
- n1 to n3 keysend set policy for n2 to not allow more than 50,000 sats send 40,000 sats from n1 to n3 sent 60,000 sats from n1 to n3 should fail revert state by sending back 40,000 sats from n3 to n1
- n2 closes channel between n1 & n2 when n1 is active
- turn off n3 and n2 closes channel n2 & n3
- n3 wakes to find everything is good