From 924b916b2a5537953b67f7db07fd9d4b62661ea8 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 8 Feb 2018 23:57:53 +1100 Subject: [PATCH] Expose Client.Closed --- client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client.go b/client.go index 5ae32af6..47bd03d8 100644 --- a/client.go +++ b/client.go @@ -368,6 +368,12 @@ func firstNonEmptyString(ss ...string) string { return "" } +func (cl *Client) Closed() <-chan struct{} { + cl.mu.Lock() + defer cl.mu.Unlock() + return cl.closed.C() +} + // Stops the client. All connections to peers are closed and all activity will // come to a halt. func (cl *Client) Close() { -- 2.50.0