From 9e5f1869032928de52123718dde9d87af91f5e40 Mon Sep 17 00:00:00 2001 From: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Date: Sun, 9 Jul 2023 13:28:22 -0400 Subject: [PATCH] fix(relayer): Don't complete slow fill-only fills (#796) --- src/relayer/Relayer.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/relayer/Relayer.ts b/src/relayer/Relayer.ts index a2c460f44..4ad0c9698 100644 --- a/src/relayer/Relayer.ts +++ b/src/relayer/Relayer.ts @@ -204,18 +204,17 @@ export class Relayer { } // If depositor is on the slow deposit list, then send a zero fill to initiate a slow relay and return early. - if ( - sendSlowRelays && - fillCount === 0 && - slowDepositors?.includes(deposit.depositor) && - tokenClient.hasBalanceForZeroFill(deposit) - ) { - this.logger.debug({ - at: "Relayer", - message: "Initiating slow fill for grey listed depositor", - depositor: deposit.depositor, - }); - this.zeroFillDeposit(deposit); + if (slowDepositors?.includes(deposit.depositor)) { + if (sendSlowRelays && fillCount === 0 && tokenClient.hasBalanceForZeroFill(deposit)) { + this.logger.debug({ + at: "Relayer", + message: "Initiating slow fill for grey listed depositor", + depositor: deposit.depositor, + }); + this.zeroFillDeposit(deposit); + } + // Regardless of whether we should send a slow fill or not for this depositor, exit early at this point + // so we don't fast fill an already slow filled deposit from the slow fill-only list. continue; }