htlcswitch+itest: catch link quit signal when processing hodlQueue
This commit makes sure when processing resolutions, e.g, settling invoices, when the link is already broken, the process would exit with an error. This fixes the issue we found in the itest, where an unexpected empty remote pending commitment was created although the remote peer is already offline.
This commit is contained in:
3 files changed
+25
No files matched your search
@@ -1582,6 +1582,11 @@ loop:
|
||||
select {
|
||||
case item := <-l.hodlQueue.ChanOut():
|
||||
htlcResolution = item.(invoices.HtlcResolution)
|
||||
|
||||
// No need to process it if the link is broken.
|
||||
case <-l.cg.Done():
|
||||
return ErrLinkShuttingDown
|
||||
|
||||
default:
|
||||
break loop
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user