~edwargix/tallyard

efe483b666c794ecdd1429845834ba80256054e8 — David Florness 4 years ago 52d939a
Throw away our private key for an election after it's over
2 files changed, 10 insertions(+), 0 deletions(-)

M cmd/tallyard/main.go
M election/voter.go
M cmd/tallyard/main.go => cmd/tallyard/main.go +2 -0
@@ 162,6 162,8 @@ func main() {
	}

	el.PrintResults()

	el.Finish()
}

func debugEventHook(_ mautrix.EventSource, evt *event.Event) {

M election/voter.go => election/voter.go +8 -0
@@ 218,3 218,11 @@ func (el *Election) SendSum(client *mautrix.Client, eventStore *EventStore) erro

	return nil
}

func (el *Election) Finish() {
	el.Lock()
	defer el.Save()
	defer el.Unlock()
	// the election is over; throw away the keys!
	el.LocalVoter = nil
}