rpc: only cancel closeObserver if force close succeeds
This commit is contained in:
parent
4d6cd2ee36
commit
7bd2cd0a16
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user