mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-28 18:55:42 +00:00
check for error when stopping WSClient
This commit is contained in:
@@ -170,9 +170,11 @@ func (c *WSClient) OnStop() {}
|
|||||||
// channel is closed.
|
// channel is closed.
|
||||||
func (c *WSClient) Stop() error {
|
func (c *WSClient) Stop() error {
|
||||||
err := c.BaseService.Stop()
|
err := c.BaseService.Stop()
|
||||||
// only close user-facing channels when we can't write to them
|
if err == nil {
|
||||||
c.wg.Wait()
|
// only close user-facing channels when we can't write to them
|
||||||
close(c.ResponsesCh)
|
c.wg.Wait()
|
||||||
|
close(c.ResponsesCh)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user