debug messages...

This commit is contained in:
Jae Kwon 2014-11-03 16:43:37 -08:00
parent 5f794d14fb
commit b97d23e538
2 changed files with 5 additions and 3 deletions

View File

@ -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)
}

View File

@ -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