|
|
@ -80,14 +80,12 @@ func BroadcastMessageFromLeader(peers []Peer, msg []byte) { |
|
|
|
// TODO(minhdoan): Enable back for multicast.
|
|
|
|
// TODO(minhdoan): Enable back for multicast.
|
|
|
|
peers = SelectMyPeers(peers, 1, MaxBroadCast) |
|
|
|
peers = SelectMyPeers(peers, 1, MaxBroadCast) |
|
|
|
BroadcastMessage(peers, msg) |
|
|
|
BroadcastMessage(peers, msg) |
|
|
|
log.Info("Done sending from leader") |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// BroadcastMessageFromValidator sends the message to a list of peers from a validator.
|
|
|
|
// BroadcastMessageFromValidator sends the message to a list of peers from a validator.
|
|
|
|
func BroadcastMessageFromValidator(selfPeer Peer, peers []Peer, msg []byte) { |
|
|
|
func BroadcastMessageFromValidator(selfPeer Peer, peers []Peer, msg []byte) { |
|
|
|
peers = SelectMyPeers(peers, selfPeer.ValidatorID*MaxBroadCast+1, (selfPeer.ValidatorID+1)*MaxBroadCast) |
|
|
|
peers = SelectMyPeers(peers, selfPeer.ValidatorID*MaxBroadCast+1, (selfPeer.ValidatorID+1)*MaxBroadCast) |
|
|
|
BroadcastMessage(peers, msg) |
|
|
|
BroadcastMessage(peers, msg) |
|
|
|
log.Info("Done sending from validator") |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ConstructP2pMessage constructs the p2p message as [messageType, contentSize, content]
|
|
|
|
// ConstructP2pMessage constructs the p2p message as [messageType, contentSize, content]
|
|
|
|