Fix data race. (#8105)

Original repro:
  go test -run TestStateFullRound1 -race -count=500 ./internal/consensus
This commit is contained in:
M. J. Fromberger
2022-03-10 14:29:13 -08:00
committed by GitHub
parent 7f85fc250a
commit 5fb791e020

View File

@@ -291,7 +291,7 @@ func validatePrevote(t *testing.T, cs *State, round int32, privVal *validatorStu
}
func validateLastPrecommit(t *testing.T, cs *State, privVal *validatorStub, blockHash []byte) {
votes := cs.LastCommit
votes := cs.GetRoundState().LastCommit
pv, err := privVal.GetPubKey(context.Background())
require.NoError(t, err)
address := pv.Address()