From 71df80859e9bc0c61d9789a4ad9411bb83784674 Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Thu, 6 May 2021 12:22:23 -0700 Subject: [PATCH] Make WaitForNetwork use netTime --- bindings/client.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bindings/client.go b/bindings/client.go index 9274be190..33ef28198 100644 --- a/bindings/client.go +++ b/bindings/client.go @@ -18,6 +18,7 @@ import ( "gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/primitives/states" "gitlab.com/xx_network/primitives/id" + "gitlab.com/xx_network/primitives/netTime" "sync" "time" ) @@ -98,7 +99,7 @@ func Login(storageDir string, password []byte, parameters string) (*Client, erro return nil, errors.New(fmt.Sprintf("Failed to login: %+v", err)) } extantClient = true - clientSingleton :=&Client{api: *client} + clientSingleton := &Client{api: *client} return clientSingleton, nil } @@ -229,9 +230,9 @@ func (c *Client) StopNetworkFollower(timeoutMS int) error { // WaitForNewtwork will block until either the network is healthy or the // passed timeout. It will return true if the network is healthy func (c *Client) WaitForNetwork(timeoutMS int) bool { - start := time.Now() + start := netTime.Now() timeout := time.Duration(timeoutMS) * time.Millisecond - for time.Now().Sub(start) < timeout { + for netTime.Now().Sub(start) < timeout { if c.api.GetHealth().IsHealthy() { return true } -- GitLab