diff --git a/node/node_handler.go b/node/node_handler.go index 881935775..f5caf7a47 100644 --- a/node/node_handler.go +++ b/node/node_handler.go @@ -43,6 +43,11 @@ func (node *Node) StreamHandler(s p2p.Stream) { utils.GetLogInstance().Error("Read p2p data failed", "err", err, "node", node) return } + node.messageHandler(content) +} + +// messageHandler parses the message and dispatch the actions +func (node *Node) messageHandler(content []byte) { node.MaybeBroadcastAsValidator(content) consensusObj := node.Consensus