mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
routing: fail in-flight attempts cleanly on terminal payment failure
In case of a multi shard payment with more than one in-flight shards, one shard quitting with a terminal failure will stop the payment lifecycle and close the `shardHandler`'s `quit` channel. In the `collectResult` function we're waiting for the `Switch` to asynchronously return a result for each shard. This may have been interrupted by the aformentioned `quit` channel's closing skipping attempt failure (or success) notification towards the control tower and therefore skipping proper settle/fail info fill in the channel db. Since payments have a composite state of a global failure reason and settle/fail info for all attempts, any attempt with an unfilled settle/fail info keeps a payment in-flight even if the payment itself isn't in-flight anymore.
This commit is contained in:
@ -597,9 +597,6 @@ func (p *shardHandler) collectResult(attempt *channeldb.HTLCAttemptInfo) (
|
||||
|
||||
case <-p.router.quit:
|
||||
return nil, ErrRouterShuttingDown
|
||||
|
||||
case <-p.quit:
|
||||
return nil, errShardHandlerExiting
|
||||
}
|
||||
|
||||
// In case of a payment failure, fail the attempt with the control
|
||||
|
Reference in New Issue
Block a user