mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 13:03:21 +02: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:
@@ -1698,6 +1698,10 @@ func GetChanPointFundingTxid(chanPoint *lnrpc.ChannelPoint) (*chainhash.Hash, er
|
|||||||
func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
|
func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
|
||||||
updateStream lnrpc.Lightning_CloseChannelServer) error {
|
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
|
// If the user didn't specify a channel point, then we'll reject this
|
||||||
// request all together.
|
// request all together.
|
||||||
if in.GetChannelPoint() == nil {
|
if in.GetChannelPoint() == nil {
|
||||||
|
Reference in New Issue
Block a user