Browse Source

consensus/state: avert a data race with state update and tests (#7643)

pull/7594/head
M. J. Fromberger 3 years ago
committed by GitHub
parent
commit
68d4fed236
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
      internal/consensus/common_test.go

+ 3
- 0
internal/consensus/common_test.go View File

@ -285,6 +285,9 @@ func validatePrevote(
) { ) {
t.Helper() t.Helper()
cs.mtx.RLock()
defer cs.mtx.RUnlock()
prevotes := cs.Votes.Prevotes(round) prevotes := cs.Votes.Prevotes(round)
pubKey, err := privVal.GetPubKey(ctx) pubKey, err := privVal.GetPubKey(ctx)
require.NoError(t, err) require.NoError(t, err)


Loading…
Cancel
Save