From eacccd9b05faa0e87f651988c93a78da29b4425a Mon Sep 17 00:00:00 2001 From: vgorkavenko Date: Tue, 5 Mar 2024 22:51:24 +0400 Subject: [PATCH] fix: conditions --- src/common/consensus-provider/consensus-provider.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/consensus-provider/consensus-provider.service.ts b/src/common/consensus-provider/consensus-provider.service.ts index d05e9c5c..2475532a 100644 --- a/src/common/consensus-provider/consensus-provider.service.ts +++ b/src/common/consensus-provider/consensus-provider.service.ts @@ -123,10 +123,10 @@ export class ConsensusProviderService { { maxRetries: this.config.get('CL_API_GET_BLOCK_INFO_MAX_RETRIES'), useFallbackOnResolved: (r) => { - if (Number(r.data.header.message.slot) > this.latestSlot.slot) { + 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 (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) {