Stop broadcasting after a timeout or cancellation

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-05 10:32:52 +02:00
parent 0d32a3b5ce
commit 00df057e09

View File

@ -133,6 +133,8 @@ public class BroadcastHandler implements PeerManager.Listener {
log.info("Broadcast message to {} peers out of {} total connected peers.", numOfPeers, connectedPeersSet.size());
for (int i = 0; i < numOfPeers; i++) {
if (stopped)
break; // do not continue sending after a timeout or a cancellation
final long minDelay = i * 30 * factor + 1;
final long maxDelay = minDelay * 2 + 30 * factor;
final Connection connection = connectedPeersList.get(i);