mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 15:22:15 +00:00
fix race condition for SetHasAllValidationCommits; "binary" log
filtering
This commit is contained in:
parent
69903e5bc2
commit
16c80fd65f
@ -1,7 +1,18 @@
|
|||||||
package binary
|
package binary
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/tendermint/log15"
|
"github.com/tendermint/log15"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = log15.New("module", "binary")
|
var log = log15.New("module", "binary")
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
log.SetHandler(
|
||||||
|
log15.LvlFilterHandler(
|
||||||
|
log15.LvlWarn,
|
||||||
|
log15.StreamHandler(os.Stderr, log15.LogfmtFormat()),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
@ -421,7 +421,7 @@ OUTER_LOOP:
|
|||||||
continue OUTER_LOOP
|
continue OUTER_LOOP
|
||||||
} else {
|
} else {
|
||||||
log.Debug("No commits to send", "ours", validation.BitArray(), "theirs", prs.Commits)
|
log.Debug("No commits to send", "ours", validation.BitArray(), "theirs", prs.Commits)
|
||||||
ps.SetHasAllValidationCommits()
|
ps.SetHasAllValidationCommits(prs.Height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,10 +569,12 @@ func (ps *PeerState) setHasVote(height uint, round uint, type_ byte, index uint)
|
|||||||
|
|
||||||
// When catching up, this helps keep track of whether
|
// When catching up, this helps keep track of whether
|
||||||
// we should send more commit votes from the block (validation) store
|
// we should send more commit votes from the block (validation) store
|
||||||
func (ps *PeerState) SetHasAllValidationCommits() {
|
func (ps *PeerState) SetHasAllValidationCommits(height uint) {
|
||||||
ps.mtx.Lock()
|
ps.mtx.Lock()
|
||||||
defer ps.mtx.Unlock()
|
defer ps.mtx.Unlock()
|
||||||
|
if ps.Height == height {
|
||||||
ps.HasAllValidationCommits = true
|
ps.HasAllValidationCommits = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage, rs *RoundState) {
|
func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage, rs *RoundState) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user