diff --git a/autopilot/agent.go b/autopilot/agent.go index 6fe72f98..90c2bbdc 100644 --- a/autopilot/agent.go +++ b/autopilot/agent.go @@ -386,9 +386,8 @@ func mergeChanState(pendingChans map[NodeID]Channel, numChans := len(pendingChans) + len(activeChans) totalChans := make([]Channel, 0, numChans) - for _, activeChan := range activeChans.Channels() { - totalChans = append(totalChans, activeChan) - } + totalChans = append(totalChans, activeChans.Channels()...) + for _, pendingChan := range pendingChans { totalChans = append(totalChans, pendingChan) } diff --git a/autopilot/choice_test.go b/autopilot/choice_test.go index 850b4440..bde48b0d 100644 --- a/autopilot/choice_test.go +++ b/autopilot/choice_test.go @@ -139,10 +139,7 @@ func assertChoice(w []float64, iterations int) bool { } // The sum of choices must be exactly iterations of course. - if totalChoices != iterations { - return false - } - return true + return totalChoices == iterations }