Merge branch 'master' of github.com:simple-rules/harmony-benchmark

pull/76/head
ak 6 years ago
commit 7a057d0d51
  1. 9
      p2p/peer.go

@ -41,14 +41,21 @@ func BroadcastMessage(peers []Peer, msg []byte) {
}
// Construct broadcast p2p message
content := ConstructP2pMessage(byte(17), msg)
length := len(content)
log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0), "Size", len(content))
log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0), "Size", length)
start := time.Now()
for _, peer := range peers {
peerCopy := peer
go send(peerCopy.Ip, peerCopy.Port, content)
}
log.Info("Broadcasting Done", "time spent(s)", time.Since(start).Seconds())
// Keep track of block propagation time
// Assume 1M message is for block propagation
if length > 1000000 {
log.Debug("NET: START BLOCK PROPAGATION", "Size", length)
}
}
func SelectMyPeers(peers []Peer, min int, max int) []Peer {

Loading…
Cancel
Save