adding log to print out the current view id

adding additional check to make sure that current view id is not zero

reset the current.viewID to block height
pull/2585/head
Ganesha Upadhyaya 5 years ago
parent a0dad48abf
commit bc75a4687f
  1. 4
      consensus/checks.go
  2. 1
      consensus/consensus_service.go

@ -242,8 +242,8 @@ func (consensus *Consensus) onViewChangeSanityCheck(recvMsg *FBFTMessage) bool {
if recvMsg.ViewID-consensus.current.ViewID() > MaxViewIDDiff {
consensus.getLogger().Debug().
Uint64("MsgViewID", recvMsg.ViewID).
Uint64("MaxViewIDDiff", MaxViewIDDiff).
Msg("Received viewID that is MaxViewIDDiff further from the current viewID!")
Uint64("CurrentViewID", consensus.current.ViewID()).
Msg("Received viewID that is MaxViewIDDiff (100) further from the current viewID!")
return false
}
return true

@ -278,6 +278,7 @@ func (consensus *Consensus) verifyViewChangeSenderKey(msg *msg_pb.Message) (*bls
// SetViewID set the viewID to the height of the blockchain
func (consensus *Consensus) SetViewID(height uint64) {
consensus.viewID = height
consensus.current.viewID = height
}
// SetMode sets the mode of consensus

Loading…
Cancel
Save