// Gossip sends a message to other peers to the network func (g *gossipServiceImpl) Gossip(msg *proto.GossipMessage) { g.logger.Info(msg) if dataMsg := msg.GetDataMsg(); dataMsg != nil { g.msgStore.add(msg) g.blocksPuller.Add(msg) } g.emitter.Add(msg) }
// New message notification/handler func (s *GossipStateProviderImpl) queueNewMessage(msg *proto.GossipMessage) { dataMsg := msg.GetDataMsg() if dataMsg != nil { // Add new payload to ordered set s.logger.Debugf("Received new payload with sequence number = [%d]", dataMsg.Payload.SeqNum) s.payloads.Push(dataMsg.GetPayload()) } else { s.logger.Debug("Gossip message received is not of data message type, usually this should not happen.") } }