multi: link quit can interrupt commitment signing

In this commit, we make sig job handling when singing a next commitment
non-blocking by allowing the shutdown of a channel link to prevent
further waiting on sig jobs by the channel state machine. This addresses
possible cases where the aux signer may be shut down via a separate quit
signal, so the state machine could block indefinitely on receiving an
update on a sig job.
This commit is contained in:
Jonathan Harvey-Buschel authored and Oliver Gugger committed 2024-10-17 17:35:29 +02:00
1 parent 6edd942c70
commit 77ae7afe78
9 files changed
+256 -177

No files matched your search

+8 -6
View File
@@ -1197,12 +1197,14 @@ func (h *hopNetwork) createChannelLink(server, peer *mockServer,
}
go func() {
for {
select {
case <-notifyUpdateChan:
case <-link.(*channelLink).quit:
close(doneChan)
return
if chanLink, ok := link.(*channelLink); ok {
for {
select {
case <-notifyUpdateChan:
case <-chanLink.Quit:
close(doneChan)
return
}
}
}
}()