PUBLISHERS BELOW GossipBlock() gossips a certificate (with block) through the P2P network for a specific chainId
(certificate *lib.QuorumCertificate, senderPubToExclude []byte, timestamp uint64)
| 96 | |
| 97 | // GossipBlock() gossips a certificate (with block) through the P2P network for a specific chainId |
| 98 | func (c *Controller) GossipBlock(certificate *lib.QuorumCertificate, senderPubToExclude []byte, timestamp uint64) { |
| 99 | // log the start of the gossip block function |
| 100 | c.log.Debugf("Gossiping certificate: %s", lib.BytesToString(certificate.ResultsHash)) |
| 101 | // create the block message to gossip |
| 102 | blockMessage := &lib.BlockMessage{ |
| 103 | ChainId: c.Config.ChainId, |
| 104 | BlockAndCertificate: certificate, |
| 105 | Time: timestamp, |
| 106 | } |
| 107 | // send the block message to all peers excluding the sender (gossip) |
| 108 | if err := c.P2P.SendToPeers(Block, blockMessage, lib.BytesToString(senderPubToExclude)); err != nil { |
| 109 | c.log.Errorf("unable to gossip block with err: %s", err.Error()) |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | // SelfSendBlock() gossips a QuorumCertificate (with block) through the P2P network for handling |
| 114 | func (c *Controller) SelfSendBlock(qc *lib.QuorumCertificate, timestamp uint64) { |
no test coverage detected