From 12dc1cdce4ff934420600bd8efb7d3484579a038 Mon Sep 17 00:00:00 2001
From: josh <josh@elixxir.io>
Date: Tue, 18 May 2021 13:40:21 -0700
Subject: [PATCH] Add ForceMessagePickupRetry flag to CLI

---
 README.md                   | 3 +++
 cmd/root.go                 | 3 +++
 interfaces/params/rounds.go | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 3827baea0..497f2c992 100644
--- a/README.md
+++ b/README.md
@@ -160,6 +160,9 @@ Flags:
                                   base64 representations) (default "0")
       --forceHistoricalRounds     Force all rounds to be sent to historical
                                   round retrieval
+      --forceMessagePickupRetry   Enable a mechanism which forces a 50% chance 
+                                  of no message pickup, instead triggering the 
+                                  message pickup retry mechanism
   -h, --help                      help for client
   -l, --log string                Path to the log output path (- is stdout)
                                   (default "-")
diff --git a/cmd/root.go b/cmd/root.go
index 9b11cfc79..ed2e2b993 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -769,6 +769,9 @@ func init() {
 		"Enables polling for unfiltered network updates with RSA signatures")
 	viper.BindPFlag("slowPolling",
 		rootCmd.Flags().Lookup("slowPolling"))
+	rootCmd.Flags().Bool("forceMessagePickupRetry", false,
+		"Enable a mechanism which forces a 50% chance of no message pickup, " +
+		"instead triggering the message pickup retry mechanism")
 
 	// E2E Params
 	defaultE2EParams := params.GetDefaultE2ESessionParams()
diff --git a/interfaces/params/rounds.go b/interfaces/params/rounds.go
index 6c4fdc5c6..0c8f33502 100644
--- a/interfaces/params/rounds.go
+++ b/interfaces/params/rounds.go
@@ -35,6 +35,10 @@ type Rounds struct {
 	// Interval between checking for rounds in UncheckedRoundStore
 	// due for a message retrieval retry
 	UncheckRoundPeriod time.Duration
+
+	// Toggles if message pickup retrying mechanism if forced
+	// by intentionally not looking up messages
+	ForceMessagePickupRetry bool
 }
 
 func GetDefaultRounds() Rounds {
-- 
GitLab