mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 04:50:16 +00:00
Read lock consensus state mutex in test helper to avoid data race
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
@@ -350,6 +350,8 @@ func validatePrecommit(
|
||||
require.True(t, bytes.Equal(vote.BlockID.Hash, votedBlockHash), "Expected precommit to be for proposal block")
|
||||
}
|
||||
|
||||
cs.mtx.RLock()
|
||||
defer cs.mtx.RUnlock()
|
||||
if lockedBlockHash == nil {
|
||||
require.False(t, cs.LockedRound != lockRound || cs.LockedBlock != nil,
|
||||
"Expected to be locked on nil at round %d. Got locked at round %d with block %v",
|
||||
|
||||
Reference in New Issue
Block a user