rpcserver: ensure server has started before CloseChannel

We do this as a general sanity check to ensure channels cannot be closed
while either the backend is still syncing or the server is still
starting.
This commit is contained in:
Wilmer Paulino 2019-10-23 17:37:01 -04:00
parent 955d143c1b
commit dd55d43520
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

View File

@ -1698,6 +1698,10 @@ func GetChanPointFundingTxid(chanPoint *lnrpc.ChannelPoint) (*chainhash.Hash, er
func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
updateStream lnrpc.Lightning_CloseChannelServer) error {
if !r.server.Started() {
return ErrServerNotActive
}
// If the user didn't specify a channel point, then we'll reject this
// request all together.
if in.GetChannelPoint() == nil {