diff --git a/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java b/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java index f778cc0eea5..df21e6a9d1f 100644 --- a/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java +++ b/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java @@ -327,17 +327,18 @@ private void updateBuilderAvailability() { .finish( statusResponse -> { if (statusResponse.getErrorMessage() != null) { - latestBuilderAvailability.set(false); - eventLogger.executionBuilderIsOffline(statusResponse.getErrorMessage()); + markBuilderAsNotAvailable(statusResponse.getErrorMessage()); } else { if (latestBuilderAvailability.compareAndSet(false, true)) { eventLogger.executionBuilderIsBackOnline(); } } }, - throwable -> { - latestBuilderAvailability.set(false); - eventLogger.executionBuilderIsOffline(throwable.getMessage()); - }); + throwable -> markBuilderAsNotAvailable(throwable.getMessage())); + } + + private void markBuilderAsNotAvailable(String errorMessage) { + latestBuilderAvailability.set(false); + eventLogger.executionBuilderIsOffline(errorMessage); } }