Skip to content

Commit

Permalink
Merge branch 'master' into npai/viem-finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai authored Feb 24, 2025
2 parents 1acfa7d + 9403e3c commit 82b441f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/relayer/Relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,15 @@ export class Relayer {
return ignoreDeposit();
}

const { minConfirmations = 100_000 } = minDepositConfirmations[originChainId].find(({ usdThreshold }) =>
// It would be preferable to use host time since it's more reliably up-to-date, but this creates issues in test.
const currentTime = spokePoolClients[destinationChainId].getCurrentTime();
if (deposit.fillDeadline <= currentTime) {
return ignoreDeposit();
}

const { minConfirmations } = minDepositConfirmations[originChainId].find(({ usdThreshold }) =>
usdThreshold.gte(fillAmountUsd)
);
) ?? { minConfirmations: 100_000 };
const { latestBlockSearched } = spokePoolClients[originChainId];
if (latestBlockSearched - blockNumber < minConfirmations) {
this.logger.debug({
Expand Down Expand Up @@ -367,12 +373,6 @@ export class Relayer {
return false;
}

// It would be preferable to use host time since it's more reliably up-to-date, but this creates issues in test.
const currentTime = spokePoolClients[destinationChainId].getCurrentTime();
if (deposit.fillDeadline <= currentTime) {
return false;
}

if (this.fillIsExclusive(deposit) && getAddress(deposit.exclusiveRelayer) !== this.relayerAddress) {
return false;
}
Expand Down

0 comments on commit 82b441f

Please sign in to comment.