Skip to content
Snippets Groups Projects
Commit 3a777b78 authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Merge branch 'hotfix/GetRoundResultsNew' into 'release'

attempt to fix GetRoundResults

See merge request !118
parents 65019043 1995f755
No related branches found
No related tags found
2 merge requests!170Release,!118attempt to fix GetRoundResults
......@@ -158,12 +158,9 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
roundCallback(false, true, roundsResults)
return
case roundReport := <-sendResults:
// Skip if the round is nil (unknown from historical rounds)
// they default to timed out, so correct behavior is preserved
if roundReport.RoundInfo == nil {
allRoundsSucceeded = false
numResults--
} else if roundReport.TimedOut {
// Skip if the round is timed out, meaning unknown from historical rounds
// or timed out on RoundEvents channel
if roundReport.TimedOut {
// Generate a message to track the timed out round
timeoutRequest := &pb.HistoricalRounds{
Rounds: []uint64{roundReport.RoundInfo.ID},
......@@ -219,9 +216,17 @@ func (c *Client) getHistoricalRounds(msg *pb.HistoricalRounds,
}
// 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{
RoundInfo: ri,
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment