mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-12 07:08:24 +01:00
htlcswitch/mailbox: fail htlcs when delayed for 1 minute
Now that packet failure is handled by the mailbox, we can now enforce a delivery deadline and fail the packet if it the deadilne is exceeded. This gives senders quicker feedback about tried routes, and allows them to try alternative paths to the destination in the meantime.
This commit is contained in:
@@ -509,6 +509,13 @@ func (l *channelLink) Stop() {
|
||||
close(l.quit)
|
||||
l.wg.Wait()
|
||||
|
||||
// Now that the htlcManager has completely exited, reset the packet
|
||||
// courier. This allows the mailbox to revaluate any lingering Adds that
|
||||
// were delivered but didn't make it on a commitment to be failed back
|
||||
// if the link is offline for an extended period of time. The error is
|
||||
// ignored since it can only fail when the daemon is exiting.
|
||||
_ = l.mailBox.ResetPackets()
|
||||
|
||||
// As a final precaution, we will attempt to flush any uncommitted
|
||||
// preimages to the preimage cache. The preimages should be re-delivered
|
||||
// after channel reestablishment, however this adds an extra layer of
|
||||
|
||||
Reference in New Issue
Block a user