diff --git a/api/results.go b/api/results.go index 4a31b66b525e60037479ac4042017b21cfece313..19424dd541097f4338b9efe01bb2f53dc39a0ca9 100644 --- a/api/results.go +++ b/api/results.go @@ -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 { - sendResults <- ds.EventReturn{ - RoundInfo: ri, + 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, + } } } }