diff --git a/cmd/root.go b/cmd/root.go index ffc9350b65121787ed0f41a695999bdae1ddd33d..d94817ec6da64b13d0e99f3a042125286ef1d6fd 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -228,10 +228,10 @@ var rootCmd = &cobra.Command{ client.GetHealth().AddChannel(connected) waitUntilConnected(connected) - //err = client.RegisterForNotifications("dJwuGGX3KUyKldWK5PgQH8:APA91bFjuvimRc4LqOyMDiy124aLedifA8DhldtaB_b76ggphnFYQWJc_fq0hzQ-Jk4iYp2wPpkwlpE1fsOjs7XWBexWcNZoU-zgMiM0Mso9vTN53RhbXUferCbAiEylucEOacy9pniN") - //if err != nil { + // err = client.RegisterForNotifications("dJwuGGX3KUyKldWK5PgQH8:APA91bFjuvimRc4LqOyMDiy124aLedifA8DhldtaB_b76ggphnFYQWJc_fq0hzQ-Jk4iYp2wPpkwlpE1fsOjs7XWBexWcNZoU-zgMiM0Mso9vTN53RhbXUferCbAiEylucEOacy9pniN") + // if err != nil { // jww.FATAL.Panicf("Failed to register for notifications: %+v", err) - //} + // } // After connection, make sure we have registered with at least // 85% of the nodes @@ -314,7 +314,7 @@ var rootCmd = &cobra.Command{ wg := &sync.WaitGroup{} sendCnt := int(viper.GetUint("sendCount")) if viper.GetBool("splitSends") { - paramsE2E.ExcludedRounds = excludedRounds.New() + paramsE2E.ExcludedRounds = excludedRounds.NewSet() } wg.Add(sendCnt) go func() { @@ -403,7 +403,7 @@ var rootCmd = &cobra.Command{ case m := <-recvCh: fmt.Printf("Message received: %s\n", string( m.Payload)) - //fmt.Printf("%s", m.Timestamp) + // fmt.Printf("%s", m.Timestamp) receiveCnt++ if receiveCnt == expectedCnt { done = true @@ -412,7 +412,7 @@ var rootCmd = &cobra.Command{ } } - //wait an extra 5 seconds to make sure no messages were missed + // wait an extra 5 seconds to make sure no messages were missed done = false timer := time.NewTimer(5 * time.Second) for !done { @@ -423,7 +423,7 @@ var rootCmd = &cobra.Command{ case m := <-recvCh: fmt.Printf("Message received: %s\n", string( m.Payload)) - //fmt.Printf("%s", m.Timestamp) + // fmt.Printf("%s", m.Timestamp) receiveCnt++ } } @@ -537,7 +537,7 @@ func createClient() *api.Client { userIDprefix := viper.GetString("userid-prefix") protoUserPath := viper.GetString("protoUserPath") - //create a new client if none exist + // create a new client if none exist if _, err := os.Stat(storeDir); os.IsNotExist(err) { // Load NDF ndfJSON, err := ioutil.ReadFile(viper.GetString("ndf")) @@ -606,7 +606,7 @@ func initClient() *api.Client { } netParams.VerboseRoundTracking = viper.GetBool("verboseRoundTracking") - //load the client + // load the client client, err := api.Login(storeDir, []byte(pass), netParams) if err != nil { jww.FATAL.Panicf("%+v", err) @@ -684,7 +684,7 @@ func printChanRequest(requestor contact.Contact, message string) { fmt.Printf(msg) msg = fmt.Sprintf("Authentication channel request message: %s\n", message) jww.INFO.Printf(msg) - //fmt.Printf(msg) + // fmt.Printf(msg) } func addPrecanAuthenticatedChannel(client *api.Client, recipientID *id.ID, @@ -747,7 +747,7 @@ func waitUntilConnected(connected chan bool) { waitTimeout := time.Duration(viper.GetUint("waitTimeout")) timeoutTimer := time.NewTimer(waitTimeout * time.Second) isConnected := false - //Wait until we connect or panic if we can't by a timeout + // Wait until we connect or panic if we can't by a timeout for !isConnected { select { case isConnected = <-connected: diff --git a/go.mod b/go.mod index f1a19bd2bf408ca227836b789135b640407e6410..ed3be37ff1c1041ef3c5092825036211e3848c71 100644 --- a/go.mod +++ b/go.mod @@ -19,10 +19,10 @@ 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.20211228002620-2500b6eeaf9f + gitlab.com/elixxir/comms v0.0.4-0.20211229173444-33e7e70d1a86 gitlab.com/elixxir/crypto v0.0.7-0.20211227194530-ccd1a1c13a48 gitlab.com/elixxir/ekv v0.1.5 - gitlab.com/elixxir/primitives v0.0.3-0.20211228002547-80bc4c20cac2 + gitlab.com/elixxir/primitives v0.0.3-0.20211229172706-598759fdea5f gitlab.com/xx_network/comms v0.0.4-0.20211227194445-c099754b3cda gitlab.com/xx_network/crypto v0.0.5-0.20211227194420-f311e8920467 gitlab.com/xx_network/primitives v0.0.4-0.20211222205802-03e9d7d835b0 diff --git a/go.sum b/go.sum index 5187f569121597b930cd2243b1b0ddb648ef8cd4..cc800676886870809281d40a21a196afd18e55fc 100644 --- a/go.sum +++ b/go.sum @@ -272,6 +272,12 @@ gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0 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.20211228002620-2500b6eeaf9f h1:I7f/t7yoxTGmD4lQT/BNHnUZEq1j9hMwmT/4v0ofJcA= gitlab.com/elixxir/comms v0.0.4-0.20211228002620-2500b6eeaf9f/go.mod h1:NbCBXlCMOhf4CwkaASTcG1ysEjlWSHezxwQtiC43zPQ= +gitlab.com/elixxir/comms v0.0.4-0.20211229172415-5d1030537852 h1:rnMUMEjReDZ0APcPl9ihJMKCDwOL8o5C+ckPfpbDzIY= +gitlab.com/elixxir/comms v0.0.4-0.20211229172415-5d1030537852/go.mod h1:ZsjJQEUHZTCmvRMbdPu/vtZ6Gp/MRx3JEIWoAXWj69g= +gitlab.com/elixxir/comms v0.0.4-0.20211229173129-9c5c27d061ce h1:RlSLHFMyfT8oyBvEYerzsH5vlX/wf4F1U5/T0dIJ2AM= +gitlab.com/elixxir/comms v0.0.4-0.20211229173129-9c5c27d061ce/go.mod h1:4NeH/X0nA2QkHmqNuq+tDEq6cqRwgaHD6ggdwwZ2uHE= +gitlab.com/elixxir/comms v0.0.4-0.20211229173444-33e7e70d1a86 h1:Sy2az2aX0x74xYj1MPCetRHVtvALPGVUH9z9kG8kbyw= +gitlab.com/elixxir/comms v0.0.4-0.20211229173444-33e7e70d1a86/go.mod h1:4NeH/X0nA2QkHmqNuq+tDEq6cqRwgaHD6ggdwwZ2uHE= 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.6/go.mod h1:V8lricBRpa8v1ySymXQ1/lsb+8/lSak5S7ZWRT6OACY= @@ -287,6 +293,10 @@ gitlab.com/elixxir/primitives v0.0.3-0.20201116174806-97f190989704/go.mod h1:3fx gitlab.com/elixxir/primitives v0.0.3-0.20211227194457-8745b796d1f5/go.mod h1:ZCFCwLN5ZFfEXduWnzhRtoCEq56kLTHAmj5IDaRcwDs= gitlab.com/elixxir/primitives v0.0.3-0.20211228002547-80bc4c20cac2 h1:sJZ8L0clBpQNTI3tHCAchKTZiuWI0MehcnQG8DPYI5M= gitlab.com/elixxir/primitives v0.0.3-0.20211228002547-80bc4c20cac2/go.mod h1:zA+1Lp9fGPo6pl1QxtMoNPLeZJ1O5m4kcH7HNxePQnQ= +gitlab.com/elixxir/primitives v0.0.3-0.20211229171537-3c77f26aa483 h1:dRSk52OjUtq1PFhirOwJ8dRKXLhOr9odgtNsC0DSCWk= +gitlab.com/elixxir/primitives v0.0.3-0.20211229171537-3c77f26aa483/go.mod h1:zA+1Lp9fGPo6pl1QxtMoNPLeZJ1O5m4kcH7HNxePQnQ= +gitlab.com/elixxir/primitives v0.0.3-0.20211229172706-598759fdea5f h1:O4khwXGk8LlPpEhtwGz/PXYo8TY0bp/12kmd2lmPWgI= +gitlab.com/elixxir/primitives v0.0.3-0.20211229172706-598759fdea5f/go.mod h1:zA+1Lp9fGPo6pl1QxtMoNPLeZJ1O5m4kcH7HNxePQnQ= gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw= gitlab.com/xx_network/comms v0.0.4-0.20211227194445-c099754b3cda h1:oWl8TuAgdx/6J9lwdH8wYGSb4W6D5TG1AZkzbA8EzbE= gitlab.com/xx_network/comms v0.0.4-0.20211227194445-c099754b3cda/go.mod h1:5arueRMa2MNa6dALnfJwyZOhqhV53Gqc+tlHRz+Ycjw= diff --git a/interfaces/params/CMIX.go b/interfaces/params/CMIX.go index 197978cad403947b062e710e29216abaab20cf7f..83a287fc460d5ce0254496d98610379fd2f8bee8 100644 --- a/interfaces/params/CMIX.go +++ b/interfaces/params/CMIX.go @@ -14,11 +14,11 @@ import ( ) type CMIX struct { - //maximum number of rounds to try and send on + // maximum number of rounds to try and send on RoundTries uint Timeout time.Duration RetryDelay time.Duration - ExcludedRounds *excludedRounds.ExcludedRounds + ExcludedRounds excludedRounds.ExcludedRounds // an alternate identity preimage to use on send. If not set, the default // for the sending identity will be used IdentityPreimage []byte diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go index 58a5e6a0bc85f000912f1444c5f3b2614fcf399d..c127168decc0838a25702e488e314ea072ee3f6e 100644 --- a/network/message/sendCmix.go +++ b/network/message/sendCmix.go @@ -78,11 +78,11 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, timeStart := netTime.Now() maxTimeout := sender.GetHostParams().SendTimeout - var attempted *excludedRounds.ExcludedRounds + var attempted excludedRounds.ExcludedRounds if cmixParams.ExcludedRounds != nil { attempted = cmixParams.ExcludedRounds } else { - attempted = excludedRounds.New() + attempted = excludedRounds.NewSet() } jww.INFO.Printf("Looking for round to send cMix message to %s "+ @@ -111,7 +111,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, msg.Digest()) } - //find the best round to send to, excluding attempted rounds + // find the best round to send to, excluding attempted rounds remainingTime := cmixParams.Timeout - elapsed bestRound, err := instance.GetWaitingRounds().GetUpcomingRealtime(remainingTime, attempted, sendTimeBuffer) if err != nil { @@ -122,7 +122,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, continue } - //add the round on to the list of attempted, so it is not tried again + // add the round on to the list of attempted, so it is not tried again attempted.Insert(bestRound.GetRoundId()) // Determine whether the selected round contains any Nodes @@ -181,7 +181,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, return 0, ephemeral.Id{}, err } - //if the comm errors or the message fails to send, continue retrying. + // if the comm errors or the message fails to send, continue retrying. if err != nil { jww.ERROR.Printf("SendCmix failed to send to EphID %d (%s) on "+ "round %d, trying a new round: %+v", ephID.Int64(), recipient, diff --git a/network/message/sendManyCmix.go b/network/message/sendManyCmix.go index 41f23beb111c06234f93cdb9cf013629fcbc1691..69043e60f24504bc1c00c37a2ec97dc807fd4d67 100644 --- a/network/message/sendManyCmix.go +++ b/network/message/sendManyCmix.go @@ -63,11 +63,11 @@ func sendManyCmixHelper(sender *gateway.Sender, id.Round, []ephemeral.Id, error) { timeStart := netTime.Now() - var attempted *excludedRounds.ExcludedRounds + var attempted excludedRounds.ExcludedRounds if param.ExcludedRounds != nil { attempted = param.ExcludedRounds } else { - attempted = excludedRounds.New() + attempted = excludedRounds.NewSet() } maxTimeout := sender.GetHostParams().SendTimeout