diff --git a/bindings/client.go b/bindings/client.go index aaaf1ac8faccce2855b491a3d5f04764e7d0cc83..caeb5f93dbad71f0b2698eb72a56558ae29f1ccf 100644 --- a/bindings/client.go +++ b/bindings/client.go @@ -232,7 +232,7 @@ func (c *Client) StopNetworkFollower() error { func (c *Client) WaitForNetwork(timeoutMS int) bool { start := netTime.Now() timeout := time.Duration(timeoutMS) * time.Millisecond - for netTime.Now().Sub(start) < timeout { + for netTime.Since(start) < timeout { if c.api.GetHealth().IsHealthy() { return true } diff --git a/go.mod b/go.mod index 751d38d99f09935e88760efb7eb2ba47be7d2755..8025c2b16af9e323d22a273e3e79de0ad97d62bc 100644 --- a/go.mod +++ b/go.mod @@ -17,13 +17,13 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.7.1 gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 - gitlab.com/elixxir/comms v0.0.4-0.20210614160131-de90e88a68cc + gitlab.com/elixxir/comms v0.0.4-0.20210614195921-6b4a37974c50 gitlab.com/elixxir/crypto v0.0.7-0.20210614155844-c1e9c23a6ba7 gitlab.com/elixxir/ekv v0.1.5 gitlab.com/elixxir/primitives v0.0.3-0.20210614155726-ebcf2d47a527 gitlab.com/xx_network/comms v0.0.4-0.20210614155654-191473de2702 gitlab.com/xx_network/crypto v0.0.5-0.20210614155554-8c333814205b - gitlab.com/xx_network/primitives v0.0.4-0.20210608160426-670aab2d82cf + gitlab.com/xx_network/primitives v0.0.4-0.20210617180018-6472489fd418 golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 golang.org/x/net v0.0.0-20210525063256-abc453219eb5 google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 // indirect diff --git a/go.sum b/go.sum index 7f1f0b4b1edfbdfcf92ef60042ae87ba814e74ce..7d4b2566ea2fb0854b09aa464304abefb6a24e14 100644 --- a/go.sum +++ b/go.sum @@ -247,8 +247,8 @@ github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0= github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0BJIk1HIzBVMjWNjIUfstrsXC2VqLYPcA= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= -gitlab.com/elixxir/comms v0.0.4-0.20210614160131-de90e88a68cc h1:MB+Ixmz/0eWt2akBYajjH2h53GF0NjWn4Oy4Q7x4QVg= -gitlab.com/elixxir/comms v0.0.4-0.20210614160131-de90e88a68cc/go.mod h1:JeCKUXRS9xP3YYGPl4+OMFdvtt7ySJIxEsL9AzgeCu0= +gitlab.com/elixxir/comms v0.0.4-0.20210614195921-6b4a37974c50 h1:ehoUUbGelvWn2UwL9UAL4ZHKvSG3CCOe9zZ9vRD1ZyI= +gitlab.com/elixxir/comms v0.0.4-0.20210614195921-6b4a37974c50/go.mod h1:JeCKUXRS9xP3YYGPl4+OMFdvtt7ySJIxEsL9AzgeCu0= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA= gitlab.com/elixxir/crypto v0.0.7-0.20210614155844-c1e9c23a6ba7 h1:UBq4/xMUWkYmEzUN2F7nLw5qQeiNKoLaoX3vZ/flz1c= @@ -271,8 +271,9 @@ gitlab.com/xx_network/crypto v0.0.5-0.20210614155554-8c333814205b/go.mod h1:wiaQ gitlab.com/xx_network/primitives v0.0.0-20200803231956-9b192c57ea7c/go.mod h1:wtdCMr7DPePz9qwctNoAUzZtbOSHSedcK++3Df3psjA= gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da/go.mod h1:OK9xevzWCaPO7b1wiluVJGk7R5ZsuC7pHY5hteZFQug= gitlab.com/xx_network/primitives v0.0.2/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= -gitlab.com/xx_network/primitives v0.0.4-0.20210608160426-670aab2d82cf h1:4snRmLHx/mgbdMtuXT2ITxyCElgvlOd7bJA1QSx0aI4= gitlab.com/xx_network/primitives v0.0.4-0.20210608160426-670aab2d82cf/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= +gitlab.com/xx_network/primitives v0.0.4-0.20210617180018-6472489fd418 h1:F52R0wvFobjkmB8YaPNHZIu0VYqwjesMBCb9T14ygW8= +gitlab.com/xx_network/primitives v0.0.4-0.20210617180018-6472489fd418/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= gitlab.com/xx_network/ring v0.0.3-0.20210527191221-ce3f170aabd5 h1:FY+4Rh1Q2rgLyv10aKJjhWApuKRCR/054XhreudfAvw= gitlab.com/xx_network/ring v0.0.3-0.20210527191221-ce3f170aabd5/go.mod h1:aLzpP2TiZTQut/PVHR40EJAomzugDdHXetbieRClXIM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= diff --git a/network/message/garbled.go b/network/message/garbled.go index 3a828b5eed2584ff323df7cdbb6016726c9dfa18..e8fb10cbe49845f7370639877c4dcdba45342a39 100644 --- a/network/message/garbled.go +++ b/network/message/garbled.go @@ -12,7 +12,7 @@ import ( "gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/stoppable" "gitlab.com/elixxir/primitives/format" - "time" + "gitlab.com/xx_network/primitives/netTime" ) // Messages can arrive in the network out of order. When message handling fails @@ -81,7 +81,7 @@ func (m *Manager) handleGarbledMessages() { // unless it is the last attempts and has been in the buffer long // enough, in which case remove it if count == m.param.MaxChecksGarbledMessage && - time.Since(timestamp) > m.param.GarbledMessageWait { + netTime.Since(timestamp) > m.param.GarbledMessageWait { garbledMsgs.Remove(grbldMsg) } else { failedMsgs = append(failedMsgs, grbldMsg) diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go index d011a533cb05aad5ecdf801267cb0db7a5f6055d..a8269ae2342d393bd84cabc849e8cd3f33a0e3d4 100644 --- a/network/message/sendCmix.go +++ b/network/message/sendCmix.go @@ -57,7 +57,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, "(msgDigest: %s)", recipient, msg.Digest()) for numRoundTries := uint(0); numRoundTries < cmixParams.RoundTries; numRoundTries++ { - elapsed := netTime.Now().Sub(timeStart) + elapsed := netTime.Since(timeStart) if elapsed > cmixParams.Timeout { jww.INFO.Printf("No rounds to send to %s (msgDigest: %s) "+ diff --git a/network/message/sendManyCmix.go b/network/message/sendManyCmix.go index e9d598182bb805fc3220804389af43456eccf022..d9e098715a5032c90ed2bef7438f15ce2714f890 100644 --- a/network/message/sendManyCmix.go +++ b/network/message/sendManyCmix.go @@ -71,7 +71,7 @@ func sendManyCmixHelper(sender *gateway.Sender, msgs map[id.ID]format.Message, "(msgDigest: %s)", recipientString, msgDigests) for numRoundTries := uint(0); numRoundTries < param.RoundTries; numRoundTries++ { - elapsed := netTime.Now().Sub(timeStart) + elapsed := netTime.Since(timeStart) if elapsed > param.Timeout { jww.INFO.Printf("No rounds to send to %s (msgDigest: %s) were found "+ diff --git a/single/transmission.go b/single/transmission.go index bbe41371d7252b29bf78b87bed37088af95c733c..c896eb7e954e55fddc7b99513635461dc755de2f 100644 --- a/single/transmission.go +++ b/single/transmission.go @@ -138,7 +138,7 @@ func (m *Manager) transmitSingleUse(partner contact2.Contact, payload []byte, } // Update the timeout for the elapsed time - roundEventTimeout := timeout - netTime.Now().Sub(timeStart) - time.Millisecond + roundEventTimeout := timeout - netTime.Since(timeStart) - time.Millisecond // Check message delivery sendResults := make(chan ds.EventReturn, 1)