Skip to content

Commit

Permalink
small nit
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Jan 12, 2025
1 parent 02f5036 commit 4760fdd
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.annotations.VisibleForTesting;
import java.time.Duration;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tech.pegasys.teku.infrastructure.async.AsyncRunner;
Expand Down Expand Up @@ -81,7 +82,7 @@ public SafeFuture<Void> requestBlocksByRange(
() ->
// adjust for slots with empty blocks
blocksRateTracker.adjustObjectsRequest(
requestApproval, listenerWithCount.count));
requestApproval, listenerWithCount.count.get()));
})
.orElseGet(
() -> {
Expand Down Expand Up @@ -115,7 +116,7 @@ public SafeFuture<Void> requestBlobSidecarsByRange(
// adjust for slots with empty blocks and slots with blobs <
// maxBlobsPerBlock
blobSidecarsRateTracker.adjustObjectsRequest(
requestApproval, listenerWithCount.count));
requestApproval, listenerWithCount.count.get()));
})
.orElseGet(
() -> {
Expand Down Expand Up @@ -146,7 +147,7 @@ public String toString() {
@VisibleForTesting
static class RpcResponseListenerWithCount<T> implements RpcResponseListener<T> {

private int count = 0;
private final AtomicInteger count = new AtomicInteger(0);

private final RpcResponseListener<T> delegate;

Expand All @@ -156,7 +157,7 @@ private RpcResponseListenerWithCount(final RpcResponseListener<T> delegate) {

@Override
public SafeFuture<?> onResponse(final T response) {
count++;
count.incrementAndGet();
return delegate.onResponse(response);
}
}
Expand Down

0 comments on commit 4760fdd

Please sign in to comment.