Skip to content

Commit

Permalink
multi: clarify co-op closure failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Oct 13, 2023
1 parent 9478b85 commit e4dd911
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions htlcswitch/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,10 @@ func (l *channelLink) htlcManager() {
return
}

l.log.Infof("Channel is in an unclean state " +
"(lingering updates), graceful shutdown of " +
"channel link not possible")

// Otherwise, the channel has lingering updates, send
// an error and continue.
req.err <- ErrLinkFailedShutdown
Expand Down
9 changes: 6 additions & 3 deletions peer/brontide.go
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,10 @@ func (p *Brontide) handleLocalCloseReq(req *htlcswitch.ChanClose) {
// failed.
if err := p.tryLinkShutdown(chanID); err != nil {
p.log.Errorf("failed link shutdown: %v", err)
req.Err <- err

req.Err <- fmt.Errorf("failed handling co-op closing "+
"request with (try force closing "+
"it instead): %w", err)
return
}

Expand Down Expand Up @@ -3683,8 +3686,8 @@ func (p *Brontide) handleCloseMsg(msg *closeMsg) {
func (p *Brontide) HandleLocalCloseChanReqs(req *htlcswitch.ChanClose) {
select {
case p.localCloseChanReqs <- req:
p.log.Info("Local close channel request delivered to " +
"peer")
p.log.Info("Local close channel request is going to be " +
"delivered to the peer")
case <-p.quit:
p.log.Info("Unable to deliver local close channel request " +
"to peer")
Expand Down

0 comments on commit e4dd911

Please sign in to comment.