diff --git a/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/ConsumerStreamObserver.java b/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/ConsumerStreamObserver.java index c5868d5d9..b124dbbbb 100644 --- a/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/ConsumerStreamObserver.java +++ b/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/ConsumerStreamObserver.java @@ -75,7 +75,7 @@ public ConsumerStreamObserver( @Override public void onNext(SubscribeStreamResponse subscribeStreamResponse) { final SubscribeStreamResponse.ResponseCase responseType = subscribeStreamResponse.getResponseCase(); - if (lastKnownStatuses.size() == lastKnownStatusesCapacity) { + if (lastKnownStatuses.size() >= lastKnownStatusesCapacity) { lastKnownStatuses.pollFirst(); } lastKnownStatuses.add(subscribeStreamResponse.toString()); diff --git a/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/PublishStreamObserver.java b/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/PublishStreamObserver.java index 6628228b2..8365983d1 100644 --- a/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/PublishStreamObserver.java +++ b/simulator/src/main/java/com/hedera/block/simulator/grpc/impl/PublishStreamObserver.java @@ -63,7 +63,7 @@ public PublishStreamObserver( */ @Override public void onNext(PublishStreamResponse publishStreamResponse) { - if (lastKnownStatuses.size() == lastKnownStatusesCapacity) { + if (lastKnownStatuses.size() >= lastKnownStatusesCapacity) { lastKnownStatuses.pollFirst(); } lastKnownStatuses.add(publishStreamResponse.toString());