rpcserver: Clarify failure closing offline channel
This commit is contained in:
1 parent
d6b9907cf5
commit
445924b7a9
4 files changed
+15
-3
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user