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

This commit is contained in:
M. J. Fromberger
2022-01-19 10:47:06 -08:00
committed by GitHub
parent 7bc3a7274a
commit 68d4fed236

View File

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