Skip to content
Snippets Groups Projects
Commit e5cc050e authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

fixed round tracker denote

parent 029293b6
Branches
No related tags found
1 merge request!53Release
...@@ -60,7 +60,12 @@ func NewRoundTracker() *RoundTracker { ...@@ -60,7 +60,12 @@ func NewRoundTracker() *RoundTracker {
func (rt *RoundTracker) denote(rid id.Round, state RoundState) { func (rt *RoundTracker) denote(rid id.Round, state RoundState) {
rt.mux.Lock() rt.mux.Lock()
defer rt.mux.Unlock() defer rt.mux.Unlock()
if storedState, exists := rt.state[rid]; exists || storedState > state { // this ensures a lower state will not overwrite a higher state.
// eg. Unchecked does not overwrite MessageAvailable
if storedState, exists := rt.state[rid]; exists && storedState < state {
jww.TRACE.Printf("did not denote round %d because " +
"stored state of %s (%d) > passed state %s (%d)",
rid, storedState, storedState, state, state)
return return
} }
rt.state[rid] = state rt.state[rid] = state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment