Merge pull request #1033 from stevenroose/close-offline

rpcserver: Clarify failure closing offline channel
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-04-06 12:20:30 -07:00
commit e30881a14c
4 files changed
+15 -3

No files matched your search

+10
View File
@@ -1071,6 +1071,16 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
}
})
} else {
// If the link is not known by the switch, we cannot gracefully close
// the channel.
channelID := lnwire.NewChanIDFromOutPoint(chanPoint)
if _, err := r.server.htlcSwitch.GetLink(channelID); err != nil {
rpcsLog.Debugf("Trying to non-force close offline channel with "+
"chan_point=%v", chanPoint)
return fmt.Errorf("unable to gracefully close channel while peer "+
"is offline (try force closing it instead): %v", err)
}
// Based on the passed fee related parameters, we'll determine
// an appropriate fee rate for the cooperative closure
// transaction.