From 6766c86eb19fe21406f4c24ae57be24e9037b31b Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Wed, 17 Jan 2024 22:44:43 +0400 Subject: [PATCH] fix: remove unnecessary condition in retry policy --- src/common/consensus-provider/consensus-provider.service.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/common/consensus-provider/consensus-provider.service.ts b/src/common/consensus-provider/consensus-provider.service.ts index fd40fbba..77b774e8 100644 --- a/src/common/consensus-provider/consensus-provider.service.ts +++ b/src/common/consensus-provider/consensus-provider.service.ts @@ -126,10 +126,7 @@ export class ConsensusProviderService { if (Number(r.data.header.message.slot) > this.latestSlot.slot) { this.latestSlot = { slot: Number(r.data.header.message.slot), fetchTime: Number(Date.now()) }; } - if (processingState.epoch < Math.trunc(this.latestSlot.slot / this.config.get('FETCH_INTERVAL_SLOTS'))) { - // if our last processed epoch is less than last, we shouldn't use fallback - return false; - } else if (Number(Date.now()) - this.latestSlot.fetchTime > 420 * 1000) { + if (Number(Date.now()) - this.latestSlot.fetchTime > 420 * 1000) { // if latest slot doesn't change ~7m we must switch to fallback this.logger.error("Latest slot hasn't changed in ~7m"); return true;