diff --git a/binary/log.go b/binary/log.go index f62db263d..c2f6e58ad 100644 --- a/binary/log.go +++ b/binary/log.go @@ -1,7 +1,18 @@ package binary import ( + "os" + "github.com/tendermint/log15" ) var log = log15.New("module", "binary") + +func init() { + log.SetHandler( + log15.LvlFilterHandler( + log15.LvlWarn, + log15.StreamHandler(os.Stderr, log15.LogfmtFormat()), + ), + ) +} diff --git a/consensus/reactor.go b/consensus/reactor.go index aa356dfb3..5c1b10c1c 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -421,7 +421,7 @@ OUTER_LOOP: continue OUTER_LOOP } else { 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 // we should send more commit votes from the block (validation) store -func (ps *PeerState) SetHasAllValidationCommits() { +func (ps *PeerState) SetHasAllValidationCommits(height uint) { ps.mtx.Lock() defer ps.mtx.Unlock() - ps.HasAllValidationCommits = true + if ps.Height == height { + ps.HasAllValidationCommits = true + } } func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage, rs *RoundState) {