diff --git a/rpcserver.go b/rpcserver.go index 29ade4fe..64f6168b 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -824,7 +824,6 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest, } defer func() { channel.Stop() - channel.CancelObserver() }() _, bestHeight, err := r.server.cc.chainIO.GetBestBlock() @@ -872,6 +871,8 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest, }, } + channel.CancelObserver() + errChan = make(chan error, 1) notifier := r.server.cc.chainNotifier go waitForChanToClose(uint32(bestHeight), notifier, errChan, chanPoint,