Browse Source

evidence: fix data race in Pool.updateValToLastHeight() (#5100)

Fixes #5098.

Is this out in a public release? If so, I'll add a changelog entry as well, for backporting.
pull/5099/head
Erik Grinaker 5 years ago
committed by GitHub
parent
commit
58113e31ae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      evidence/pool.go

+ 3
- 0
evidence/pool.go View File

@ -712,6 +712,9 @@ func evMapKey(ev types.Evidence) string {
}
func (evpool *Pool) updateValToLastHeight(blockHeight int64, state sm.State) {
evpool.mtx.Lock()
defer evpool.mtx.Unlock()
// Update current validators & add new ones.
for _, val := range state.Validators.Validators {
evpool.valToLastHeight[string(val.Address)] = blockHeight


Loading…
Cancel
Save