Skip to content

Commit

Permalink
fix: conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Mar 5, 2024
1 parent 6516470 commit eacccd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/consensus-provider/consensus-provider.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eacccd9

Please sign in to comment.