File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -135,20 +135,22 @@ export const processTx = async () => {
135
135
return ;
136
136
}
137
137
138
- // - For each wallet address, check the nonce in database and the mempool
139
- const [ walletBalance , mempoolNonceData , dbNonceData , gasOverrides ] =
138
+ // Important: We need to block this worker until the nonce lock is acquired
139
+ const dbNonceData = await getWalletNonce ( {
140
+ pgtx,
141
+ chainId,
142
+ address : walletAddress ,
143
+ } ) ;
144
+
145
+ // For each wallet address, check the nonce in database and the mempool
146
+ const [ walletBalance , mempoolNonceData , gasOverrides ] =
140
147
await Promise . all ( [
141
148
sdk . wallet . balance ( ) ,
142
149
sdk . wallet . getNonce ( "pending" ) ,
143
- getWalletNonce ( {
144
- pgtx,
145
- chainId,
146
- address : walletAddress ,
147
- } ) ,
148
150
getDefaultGasOverrides ( provider ) ,
149
151
] ) ;
150
152
151
- // Wallet Balance Webhook
153
+ // Wallet balance webhook
152
154
if (
153
155
BigNumber . from ( walletBalance . value ) . lte (
154
156
BigNumber . from ( config . minWalletBalance ) ,
You can’t perform that action at this time.
0 commit comments