Skip to content

Commit 42ee0b0

Browse files
authored
fix: nonce resync worker returns too early with multiple sender wallets (#724)
1 parent 80300b6 commit 42ee0b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/worker/tasks/nonceResyncWorker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Job, Processor, Worker } from "bullmq";
1+
import { Worker, type Job, type Processor } from "bullmq";
22
import { eth_getTransactionCount, getRpcClient } from "thirdweb";
33
import {
44
inspectNonce,
@@ -58,7 +58,7 @@ const handler: Processor<any, void, string> = async (job: Job<string>) => {
5858
inspectNonce(chainId, walletAddress),
5959
]);
6060

61-
if (isNaN(transactionCount)) {
61+
if (Number.isNaN(transactionCount)) {
6262
job.log(
6363
`Received invalid onchain transaction count for ${walletAddress}: ${transactionCount}`,
6464
);
@@ -67,7 +67,7 @@ const handler: Processor<any, void, string> = async (job: Job<string>) => {
6767
message: `[nonceResyncWorker] Received invalid onchain transaction count for ${walletAddress}: ${transactionCount}`,
6868
service: "worker",
6969
});
70-
return;
70+
continue;
7171
}
7272

7373
const lastUsedNonceOnchain = transactionCount - 1;
@@ -90,7 +90,7 @@ const handler: Processor<any, void, string> = async (job: Job<string>) => {
9090
message: `[nonceResyncWorker] No need to resync nonce for ${walletAddress}`,
9191
service: "worker",
9292
});
93-
return;
93+
continue;
9494
}
9595

9696
// for each nonce between last used db nonce and last used onchain nonce

0 commit comments

Comments
 (0)