diff --git a/blockchain-watcher/src/infrastructure/rpc/http/HealthyProvidersPool.ts b/blockchain-watcher/src/infrastructure/rpc/http/HealthyProvidersPool.ts index b7848dca2..ab0d892ee 100644 --- a/blockchain-watcher/src/infrastructure/rpc/http/HealthyProvidersPool.ts +++ b/blockchain-watcher/src/infrastructure/rpc/http/HealthyProvidersPool.ts @@ -100,7 +100,7 @@ export class HealthyProvidersPool< const nextMaxHeight = Math.max(...heights.filter((h) => h < maxHeight)); // Filter out the maximum height if it's significantly ahead - if (nextMaxHeight && maxHeight - nextMaxHeight > THRESHOLD) { + if (!nextMaxHeight && maxHeight - nextMaxHeight > THRESHOLD) { providers = providerWithHeight.filter( (item) => parseFloat(String(item.height)) < maxHeight );