diff --git a/peer/brontide.go b/peer/brontide.go index 437aefcfa..f50cba89b 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -3627,6 +3627,9 @@ func newChanErrorReporter(chanID lnwire.ChannelID, // // This is a part of the chancloser.ErrorReporter interface. func (c *chanErrorReporter) ReportError(chanErr error) { + c.peer.log.Errorf("coop close error for channel %v: %v", + c.chanID, chanErr) + var errMsg []byte if errors.Is(chanErr, chancloser.ErrInvalidStateTransition) { errMsg = []byte("unexpected protocol message") @@ -3822,6 +3825,8 @@ func (p *Brontide) initRbfChanCloser( // Finally, we'll register this new endpoint with the message router so // future co-op close messages are handled by this state machine. err = fn.MapOptionZ(p.msgRouter, func(r msgmux.Router) error { + _ = r.UnregisterEndpoint(chanCloser.Name()) + return r.RegisterEndpoint(&chanCloser) }) if err != nil {