mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
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:
parent
955d143c1b
commit
dd55d43520
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user