@@ -194,25 +194,6 @@ export class PrivateMempool
194194
195195 const signedTransaction = tx . toProtocolTransaction ( ) ;
196196
197- // eslint-disable-next-line no-await-in-loop
198- const removeTxWhen = await this . accountStateHook . removeTransactionWhen ( {
199- networkState : networkState ,
200- transaction : signedTransaction . transaction ,
201- signature : signedTransaction . signature ,
202- prover : proverState ,
203- } ) ;
204- if ( removeTxWhen ) {
205- // eslint-disable-next-line no-await-in-loop
206- await this . transactionStorage . removeTx (
207- [ tx . hash ( ) . toString ( ) ] ,
208- "dropped"
209- ) ;
210- log . trace (
211- `Deleting tx ${ tx . hash ( ) . toString ( ) } from mempool because removeTransactionWhen condition is satisfied`
212- ) ;
213- // eslint-disable-next-line no-continue
214- continue ;
215- }
216197 // eslint-disable-next-line no-await-in-loop
217198 await this . accountStateHook . beforeTransaction ( {
218199 networkState : networkState ,
@@ -243,6 +224,26 @@ export class PrivateMempool
243224 queue = queue . filter ( distinctByPredicate ( ( a , b ) => a === b ) ) ;
244225 }
245226 } else {
227+ // eslint-disable-next-line no-await-in-loop
228+ const removeTxWhen = await this . accountStateHook . removeTransactionWhen ( {
229+ networkState : networkState ,
230+ transaction : signedTransaction . transaction ,
231+ signature : signedTransaction . signature ,
232+ prover : proverState ,
233+ } ) ;
234+ if ( removeTxWhen ) {
235+ // eslint-disable-next-line no-await-in-loop
236+ await this . transactionStorage . removeTx (
237+ [ tx . hash ( ) . toString ( ) ] ,
238+ "dropped"
239+ ) ;
240+ log . trace (
241+ `Deleting tx ${ tx . hash ( ) . toString ( ) } from mempool because removeTransactionWhen condition is satisfied`
242+ ) ;
243+ // eslint-disable-next-line no-continue
244+ continue ;
245+ }
246+
246247 log . trace (
247248 `Skipped tx ${ tx . hash ( ) . toString ( ) } because ${ statusMessage } `
248249 ) ;
0 commit comments