mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
check for error when stopping WSClient
This commit is contained in:
parent
69b5da766c
commit
c6b2334fa3
@ -170,9 +170,11 @@ func (c *WSClient) OnStop() {}
|
||||
// channel is closed.
|
||||
func (c *WSClient) Stop() error {
|
||||
err := c.BaseService.Stop()
|
||||
// only close user-facing channels when we can't write to them
|
||||
c.wg.Wait()
|
||||
close(c.ResponsesCh)
|
||||
if err == nil {
|
||||
// only close user-facing channels when we can't write to them
|
||||
c.wg.Wait()
|
||||
close(c.ResponsesCh)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user