From b97d23e538ec762d17e0bbc669a2cdb0a9f0b9c2 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 3 Nov 2014 16:43:37 -0800 Subject: [PATCH] debug messages... --- consensus/reactor.go | 6 +++--- consensus/state.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/consensus/reactor.go b/consensus/reactor.go index 76d6a3200..7076bce3c 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -708,7 +708,7 @@ func (m *CommitMessage) WriteTo(w io.Writer) (n int64, err error) { } func (m *CommitMessage) String() string { - return fmt.Sprintf("[Commit %v/%v/%v]", m.Height, m.BlockParts, m.BlockBitArray) + return fmt.Sprintf("[Commit %v %v %v]", m.Height, m.BlockParts, m.BlockBitArray) } //------------------------------------- @@ -744,7 +744,7 @@ func (m *PartMessage) WriteTo(w io.Writer) (n int64, err error) { } func (m *PartMessage) String() string { - return fmt.Sprintf("[PartMessage H:%v R:%v T:%X]", m.Height, m.Round, m.Type) + return fmt.Sprintf("[Part %v/%v T:%X]", m.Height, m.Round, m.Type) } //------------------------------------- @@ -775,5 +775,5 @@ func (m *HasVoteMessage) WriteTo(w io.Writer) (n int64, err error) { } func (m *HasVoteMessage) String() string { - return fmt.Sprintf("[HasVoteMessage H:%v R:%v T:%X]", m.Height, m.Round, m.Type) + return fmt.Sprintf("[HasVote %v/%v T:%X]", m.Height, m.Round, m.Type) } diff --git a/consensus/state.go b/consensus/state.go index 1f51107c1..06aca00c2 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -694,6 +694,7 @@ func (cs *ConsensusState) RunActionCommit(height uint32) { // If we have +2/3 commits, set the CommitTime if cs.Commits.HasTwoThirdsMajority() { cs.CommitTime = time.Now() + log.Debug("Set CommitTime to %v", cs.CommitTime) } } @@ -726,6 +727,7 @@ func (cs *ConsensusState) TryFinalizeCommit(height uint32) bool { err := cs.stageBlock(cs.ProposalBlock, cs.ProposalBlockParts) if err == nil { + log.Debug("Finalizing commit of block: %v", cs.ProposalBlock) // Increment height. cs.updateToState(cs.stagedState) // cs.Step is now RoundStepNewHeight or RoundStepNewRound