Skip to content
Snippets Groups Projects
Commit 1ceb41d6 authored by Josh Brooks's avatar Josh Brooks
Browse files

In cmd/ verify confirm sending on verify-send flag

parent e29d36b9
No related branches found
No related tags found
1 merge request!510Release
......@@ -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
}
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment