M cmd/tallyard/main.go => cmd/tallyard/main.go +2 -8
@@ 129,16 129,10 @@ func main() {
// vote if we need to (user may have voted in previous tallyard
// invocation)
- if el.LocalVoter.Ballot == nil {
+ if el.LocalVoter.Poly == nil {
candidates := el.Candidates
ballot := ui.VoteTUI(candidates)
- el.LocalVoter.Ballot = &ballot
- el.Save()
- }
-
- // set random poly with ballot if we haven't already
- if el.LocalVoter.Poly == nil {
- el.LocalVoter.Poly = math.NewRandomPoly(uint(len(*el.FinalJoinIDs)-1), 1024, *el.LocalVoter.Ballot)
+ el.LocalVoter.Poly = math.NewRandomPoly(uint(len(*el.FinalJoinIDs)-1), 1024, ballot)
el.Save()
}
M election/map.go => election/map.go +1 -1
@@ 38,7 38,7 @@ type ElectionsMap struct {
Ltime time.Time `json:"-"`
}
-const electionsMapVersion = 4
+const electionsMapVersion = 5
var electionsFname = xdg.DataHome() + "/tallyard/elections.json"
M election/voter.go => election/voter.go +0 -1
@@ 32,7 32,6 @@ type Voter struct {
type LocalVoter struct {
*Voter
- Ballot *[]byte `json:"ballot,omitempty"`
Poly *math.Poly `json:"poly,omitempty"`
PrivKey [32]byte `json:"priv_key"`
}