Today when we receive a shutdown requests, we'll remove the link from the switch entirely also (
|
// Optimistically try a link shutdown, erroring out if it |
|
// failed. |
|
if err := p.tryLinkShutdown(chanID); err != nil { |
|
peerLog.Errorf("failed link shutdown: %v", err) |
|
req.Err <- err |
|
return |
|
} |
). This means that any inbound messages to the link will be
dropped from the peer's readHandler. This was fine when we wanted to not process any further updates, but breaks down given that the spec requires (being updated to make this more clear) that one still process
updateFee messages after a shutdown has been sent (but before the first closing signed).
What we should still remove the link from the switch and send out a disable, but we need to special case for the sig+revoke and UpdateFee messages when we're in this state. One way to do this (given we already have the channel struct at that point) would be to manually feed in these messages into the channel state machine.
Steps To Completion
Today when we receive a shutdown requests, we'll remove the link from the switch entirely also (
lnd/peer/brontide.go
Lines 2695 to 2701 in ddeccf8
readHandler. This was fine when we wanted to not process any further updates, but breaks down given that the spec requires (being updated to make this more clear) that one still processupdateFeemessages after a shutdown has been sent (but before the first closing signed).What we should still remove the link from the switch and send out a disable, but we need to special case for the sig+revoke and
UpdateFeemessages when we're in this state. One way to do this (given we already have the channel struct at that point) would be to manually feed in these messages into the channel state machine.Steps To Completion
readHandlerloop to send any update messages post channel close into the chan closerUpdateFeemessage, generating the corresponding messages needed to fully lock in the change.