mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Cleanup
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
fd2cd53e64
commit
10fa08b042
@ -35,6 +35,7 @@ import com.google.common.util.concurrent.SettableFuture;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@ -310,8 +311,8 @@ public class BroadcastHandler implements PeerManager.Listener {
|
||||
if (numOfCompletedBroadcasts.get() == numOfCompletedBroadcastsTarget) {
|
||||
// We have heard back from 3 peers (or all peers if numPeers is lower) so we consider the message was sufficiently broadcast.
|
||||
broadcastRequests.stream()
|
||||
.filter(broadcastRequest -> broadcastRequest.getListener() != null)
|
||||
.map(Broadcaster.BroadcastRequest::getListener)
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(listener -> listener.onSufficientlyBroadcast(broadcastRequests));
|
||||
} else {
|
||||
// We check if number of open requests to peers is less than we need to reach numOfCompletedBroadcastsTarget.
|
||||
@ -323,8 +324,8 @@ public class BroadcastHandler implements PeerManager.Listener {
|
||||
boolean timeoutAndNotEnoughSucceeded = timeoutTriggered.get() && numOfCompletedBroadcasts.get() < numOfCompletedBroadcastsTarget;
|
||||
if (notEnoughSucceededOrOpen || timeoutAndNotEnoughSucceeded) {
|
||||
broadcastRequests.stream()
|
||||
.filter(broadcastRequest -> broadcastRequest.getListener() != null)
|
||||
.map(Broadcaster.BroadcastRequest::getListener)
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(listener -> listener.onNotSufficientlyBroadcast(numOfCompletedBroadcasts.get(), numOfFailedBroadcasts.get()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user