[log] print a message in validator if consensus reached

This will help node runners check the status in the validator's local log.

Signed-off-by: Leo Chen <leo@harmony.one>
pull/659/head
Leo Chen 6 years ago
parent 971364638c
commit 53317c5204
  1. 5
      consensus/consensus.go
  2. 3
      node/node_handler.go

@ -641,3 +641,8 @@ func (consensus *Consensus) GetLeaderPubKey() *bls.PublicKey {
func (consensus *Consensus) GetNumPeers() int {
return len(consensus.PublicKeys)
}
// GetConsensusID returns the consensus ID
func (consensus *Consensus) GetConsensusID() uint32 {
return consensus.consensusID
}

@ -281,7 +281,10 @@ func (node *Node) PostConsensusProcessing(newBlock *types.Block) {
utils.GetLogInstance().Info("PostConsensusProcessing")
if node.Consensus.IsLeader {
node.BroadcastNewBlock(newBlock)
} else {
utils.GetLogInstance().Info("BINGO !!! Reached Consensus", "ConsensusID", node.Consensus.GetConsensusID())
}
node.AddNewBlock(newBlock)
// TODO: enable drand only for beacon chain

Loading…
Cancel
Save