Пример #1
0
func (this *Election) doRestoreElection(state *thispb.ElectionState) {
	atomic.StoreInt64(&this.currentRound, state.GetCurrentRound())
	this.currentWinner = state.GetCurrentWinner()
}
Пример #2
0
func (this *Election) doSaveElection(state *thispb.ElectionState) {
	state.CurrentRound = proto.Int64(this.CurrentRound())
	state.CurrentWinner = proto.String(this.currentWinner)
}