Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: general improvements in tm2/bft/consensus #1495

Closed
wants to merge 13 commits into from
8 changes: 4 additions & 4 deletions tm2/pkg/bft/consensus/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)
ps.ApplyHasVoteMessage(msg)
case *VoteSetMaj23Message:
cs := conR.conS
cs.mtx.Lock()
cs.mtx.RLock()
petar-dambovaliev marked this conversation as resolved.
Show resolved Hide resolved
height, votes := cs.Height, cs.Votes
cs.mtx.Unlock()
cs.mtx.RUnlock()
if height != msg.Height {
return
}
Expand Down Expand Up @@ -324,9 +324,9 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)
switch msg := msg.(type) {
case *VoteSetBitsMessage:
cs := conR.conS
cs.mtx.Lock()
cs.mtx.RLock()
height, votes := cs.Height, cs.Votes
cs.mtx.Unlock()
cs.mtx.RUnlock()

if height == msg.Height {
var ourVotes *bitarray.BitArray
Expand Down
Loading