diff --git a/p2p/src/main/java/bisq/network/p2p/network/Connection.java b/p2p/src/main/java/bisq/network/p2p/network/Connection.java index ad92ef25ee3..16c1758f992 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/Connection.java +++ b/p2p/src/main/java/bisq/network/p2p/network/Connection.java @@ -378,9 +378,10 @@ private boolean violatesThrottleLimit(NetworkEnvelope networkEnvelope) { .collect(Collectors.toList()).toString()); } } - // we limit to max 1000 (MSG_THROTTLE_PER_10SEC) entries - messageTimeStamps.remove(0); } + // we limit to max 1000 (MSG_THROTTLE_PER_10SEC) entries + while(messageTimeStamps.size() > MSG_THROTTLE_PER_10_SEC) + messageTimeStamps.remove(0); messageTimeStamps.add(new Tuple2<>(now, networkEnvelope)); return violated;