From fd84f847e0a1221fdb77e4a32eb72f1efa47b0a6 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 15 Oct 2020 06:52:44 +0000 Subject: [PATCH] [viewchange] handle conseneus message construct errors Signed-off-by: Leo Chen --- consensus/validator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/consensus/validator.go b/consensus/validator.go index f502a871f..c39297265 100644 --- a/consensus/validator.go +++ b/consensus/validator.go @@ -102,11 +102,15 @@ func (consensus *Consensus) sendCommitMessages(blockObj *types.Block) { continue } - networkMessage, _ := consensus.construct( + networkMessage, err := consensus.construct( msg_pb.MessageType_COMMIT, commitPayload, &key, ) + if err != nil { + consensus.getLogger().Warn().Msg("[sendCommitMessages] cannot construct network message") + continue + } if consensus.current.Mode() != Listening { if err := consensus.msgSender.SendWithoutRetry(