Commit bba3590a authored by Anders Jensen Løvig's avatar Anders Jensen Løvig
Browse files

Fix wait for tallies

parent cbc4b7df
......@@ -258,7 +258,10 @@ func (election *Election) nextPhase(reason Reason) {
// Only tally if we have ballots
if election.ballotBox.Size() != 0 {
list, err := election.Agreement.TallyList()
if err == nil {
if err != nil {
log.Println("Election: error:", err)
log.Println("Election: waiting for tallies from other servers")
} else {
tally := election.ballotBox.Tally(list)
election.Status.TalliedServers[election.ServerID] = true
err = election.tallyBox.Put(tally)
......@@ -266,9 +269,8 @@ func (election *Election) nextPhase(reason Reason) {
panic(err) // Should not happen
}
election.server.Broadcast(network.NewMessage(MsgTally, tally))
break
}
log.Println("Should really wait for tallies from other servers !!! :D")
break
}
fallthrough
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment