diff --git a/cmd/callbacks.go b/cmd/callbacks.go index 66a6ba9f2784540811ad192334d8270ded4005d1..13900622395ed2e6b787df1b2d7d22c426cb8c61 100644 --- a/cmd/callbacks.go +++ b/cmd/callbacks.go @@ -10,6 +10,7 @@ package cmd import ( "fmt" + "github.com/spf13/viper" "gitlab.com/elixxir/client/xxdk" jww "github.com/spf13/jwalterweatherman" @@ -46,10 +47,12 @@ func (a *authCallbacks) Request(requestor contact.Contact, if a.autoConfirm { jww.INFO.Printf("Channel Request: %s", requestor.ID) - _, err := a.client.GetAuth().Confirm(requestor) - if err != nil { - jww.FATAL.Panicf("%+v", err) + if viper.GetBool("verify-sends") { // Verify message sends were successful + acceptChannelVerified(a.client, requestor.ID) + } else { + acceptChannel(a.client, requestor.ID) } + a.confCh <- requestor.ID } diff --git a/cmd/root.go b/cmd/root.go index 2f0c0c013d1093b942e2bf4bf3fc2597099a7f92..bd49ab29c517a2b51a7f2058f3dba526624f0a76 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -263,12 +263,11 @@ var rootCmd = &cobra.Command{ // Accept auth request for this recipient authConfirmed := false paramsE2E := e2e.GetDefaultParams() - roundTimeout := paramsE2E.CMIXParams.SendTimeout if viper.GetBool("accept-channel") { // Verify that the confirmation message makes it to the // original sender if viper.GetBool("verify-sends") { - acceptChannelVerified(client, recipientID, roundTimeout) + acceptChannelVerified(client, recipientID) } else { // Accept channel, agnostic of round result acceptChannel(client, recipientID) @@ -832,8 +831,10 @@ func resetAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID, } } -func acceptChannelVerified(client *xxdk.E2e, recipientID *id.ID, - roundTimeout time.Duration) { +func acceptChannelVerified(client *xxdk.E2e, recipientID *id.ID) { + paramsE2E := e2e.GetDefaultParams() + roundTimeout := paramsE2E.CMIXParams.SendTimeout + done := make(chan struct{}, 1) retryChan := make(chan struct{}, 1) for {