Skip to content
Snippets Groups Projects
Commit 1995f755 authored by Jake Taylor's avatar Jake Taylor
Browse files

attempt to fix GetRoundResults

parent 65019043
Branches
Tags
2 merge requests!170Release,!118attempt to fix GetRoundResults
...@@ -158,12 +158,9 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -158,12 +158,9 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
roundCallback(false, true, roundsResults) roundCallback(false, true, roundsResults)
return return
case roundReport := <-sendResults: case roundReport := <-sendResults:
// Skip if the round is nil (unknown from historical rounds) // Skip if the round is timed out, meaning unknown from historical rounds
// they default to timed out, so correct behavior is preserved // or timed out on RoundEvents channel
if roundReport.RoundInfo == nil { if roundReport.TimedOut {
allRoundsSucceeded = false
numResults--
} else if roundReport.TimedOut {
// Generate a message to track the timed out round // Generate a message to track the timed out round
timeoutRequest := &pb.HistoricalRounds{ timeoutRequest := &pb.HistoricalRounds{
Rounds: []uint64{roundReport.RoundInfo.ID}, Rounds: []uint64{roundReport.RoundInfo.ID},
...@@ -219,9 +216,17 @@ func (c *Client) getHistoricalRounds(msg *pb.HistoricalRounds, ...@@ -219,9 +216,17 @@ func (c *Client) getHistoricalRounds(msg *pb.HistoricalRounds,
} }
// Service historical rounds, sending back to the caller thread // Service historical rounds, sending back to the caller thread
for _, ri := range resp.Rounds { for i, ri := range resp.Rounds {
if ri == nil {
// Handle unknown by historical rounds
sendResults <- ds.EventReturn{
RoundInfo: &pb.RoundInfo{ID: msg.Rounds[i]},
TimedOut: true,
}
} else {
sendResults <- ds.EventReturn{ sendResults <- ds.EventReturn{
RoundInfo: ri, RoundInfo: ri,
} }
} }
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment