From c2e995b815f6bd8662fa2dcf68fbc7025be6eaf4 Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Tue, 7 Jun 2022 12:00:31 -0500
Subject: [PATCH] cleanup round result

---
 cmix/results.go | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/cmix/results.go b/cmix/results.go
index d5bdc7ad4..b8b9aad80 100644
--- a/cmix/results.go
+++ b/cmix/results.go
@@ -135,28 +135,18 @@ func (c *client) getRoundResults(roundList []id.Round, timeout time.Duration,
 			}
 		}
 	}
-	historicalRoundsCh := make(chan RoundResult, len(historicalRequest))
+
 	// Find out what happened to old (historical) rounds if any are needed
 	if len(historicalRequest) > 0 {
 		for _, rnd := range historicalRequest {
 			rrc := func(round rounds.Round, success bool) {
-				var status RoundLookupStatus
-				if success {
-					status = Succeeded
-				} else {
-					status = TimeOut
-				}
-				historicalRoundsCh <- RoundResult{
-					Status: status,
-					Round:  round,
-				}
-			}
-			err := c.Retriever.LookupHistoricalRound(rnd, rrc)
-			if err != nil {
-				historicalRoundsCh <- RoundResult{
-					Status: TimeOut,
+				result := ds.EventReturn{
+					RoundInfo: round.Raw,
+					TimedOut:  success,
 				}
+				sendResults <- result
 			}
+			_ = c.Retriever.LookupHistoricalRound(rnd, rrc)
 		}
 
 	}
@@ -181,8 +171,6 @@ func (c *client) getRoundResults(roundList []id.Round, timeout time.Duration,
 			case <-timer.C:
 				roundCallback(false, true, roundsResults)
 				return
-			case result = <-historicalRoundsCh:
-				hasResult = true
 			case roundReport := <-sendResults:
 				numResults--
 
-- 
GitLab