mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 05:42:34 +02:00
rpcserver: Clarify failure closing offline channel
This commit is contained in:
10
rpcserver.go
10
rpcserver.go
@@ -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