lightninglabs / lightning-dev-site

Lightning Network Daemon Developer Site
25 stars 40 forks source link

Stage 1 - Payment channel is not switching when intermediaries of one channel doesn't have sufficient funds in multi-hop payment channel #37

Open prishabh opened 6 years ago

prishabh commented 6 years ago

Scenario: We were trying multi-hop payment from A to C A opened a channel of 50000 satoshis with B (local balance: 40000, remote balance:0 with respect to A) B opened a channel of 80000 satoshis with C (local balance: 70000, remote balance:0 with respect to B) A opened a channel of 90000 satoshis with D (local balance: 80000, remote balance:0 with respect to A) D opened a channel of 55000 satoshis with C (local balance: 45000, remote balance:0 with respect to D) Available channels: A -----> B ------>C A -----> D ------>C Now, C added an invoice of 20000 satoshis. A----->D----->C channel was randomly selected for multi-hop payment Balances was updated on A ------>D------->C In A -----> D; A: 60000 and D: 20000 In D -----> C; D: 25000 and C: 20000

Again, C added an invoice of 30000

Expected result: Now, channel A----->B----->C should be used to settle this payment because D doesn't have sufficient funds.

But we are getting this { "payment_error": "unable to route payment to destination: TemporaryChannelFailure", "payment_preimage": "", "payment_route": null }