Skip to content

Commit

Permalink
Added additional logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen committed Jan 26, 2024
1 parent 0c53d2d commit 603d48a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/consensus_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ func (consensus *Consensus) setupForNewConsensus(blk *types.Block, committedMsg
if next := consensus.rotateLeader(epoch, committedMsg.SenderPubkeys[0]); next != nil {
prev := consensus.getLeaderPubKey()
consensus.setLeaderPubKey(next)
if consensus.isLeader() {
utils.Logger().Info().Msgf("We are block %d, I am the new leader %s", blk.NumberU64(), next.Bytes.Hex())
} else {
utils.Logger().Info().Msgf("We are block %d, the leader is %s", blk.NumberU64(), next.Bytes.Hex())
}
if consensus.isLeader() && !consensus.getLeaderPubKey().Object.IsEqual(prev.Object) {
// leader changed
blockPeriod := consensus.BlockPeriod
Expand Down

0 comments on commit 603d48a

Please sign in to comment.