]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Expose Client.Closed
authorMatt Joiner <anacrolix@gmail.com>
Thu, 8 Feb 2018 12:57:53 +0000 (23:57 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 8 Feb 2018 12:57:53 +0000 (23:57 +1100)
client.go

index 5ae32af67d99042af1451d42f31587be511414e3..47bd03d812d8091d35092da1cdf8b9320beed0eb 100644 (file)
--- 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() {