From dd55d435203853d3aadee7dd9ad37aefd938cae3 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 23 Oct 2019 17:37:01 -0400 Subject: [PATCH] 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. --- rpcserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index e4928d9e..3553f50e 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -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 {