GossipConsensus() gossips a consensus message through the P2P network for a specific chainId
(message *bft.Message, senderPubToExclude []byte)
| 362 | |
| 363 | // GossipConsensus() gossips a consensus message through the P2P network for a specific chainId |
| 364 | func (c *Controller) GossipConsensus(message *bft.Message, senderPubToExclude []byte) { |
| 365 | // log the start of the gossip consensus message function |
| 366 | var phase lib.Phase |
| 367 | if message.Qc == nil { |
| 368 | phase = message.Header.Phase |
| 369 | } else { |
| 370 | phase = message.Qc.Header.Phase |
| 371 | } |
| 372 | c.log.Debugf("Gossiping consensus message: P: %s %s", phase, |
| 373 | crypto.HashString([]byte(message.String()))) |
| 374 | // send the consensus message to all peers excluding the sender (gossip) |
| 375 | if err := c.P2P.SendToPeers(Cons, message, lib.BytesToString(senderPubToExclude)); err != nil { |
| 376 | c.log.Errorf("unable to gossip consensus message with err: %s", err.Error()) |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | // ListenForBlockRequests() listen for inbound block request messages from syncing peers, handles and answer them |
| 381 | func (c *Controller) ListenForBlockRequests() { |
no test coverage detected