Browse Source

debug messages...

pull/9/head
Jae Kwon 10 years ago
parent
commit
b97d23e538
2 changed files with 5 additions and 3 deletions
  1. +3
    -3
      consensus/reactor.go
  2. +2
    -0
      consensus/state.go

+ 3
- 3
consensus/reactor.go 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)
}

+ 2
- 0
consensus/state.go 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


Loading…
Cancel
Save