File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
yarn-project/p2p/src/mem_pools/tx_pool Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -663,18 +663,22 @@ export class AztecKVTxPool
663663 * Iterates the priority index in ascending order and skips non-evictable txs.
664664 */
665665 public async getLowestPriorityEvictable ( limit : number ) : Promise < TxHash [ ] > {
666- const result : TxHash [ ] = [ ] ;
666+ const txsToEvict : TxHash [ ] = [ ] ;
667667 if ( limit <= 0 ) {
668- return result ;
668+ return txsToEvict ;
669669 }
670+
670671 for await ( const txHashStr of this . #pendingTxPriorityToHash. valuesAsync ( ) ) {
671- if ( ! this . #nonEvictableTxs. has ( txHashStr ) ) {
672- result . push ( TxHash . fromString ( txHashStr ) ) ;
673- if ( result . length >= limit ) {
674- break ;
675- }
672+ if ( this . #nonEvictableTxs. has ( txHashStr ) ) {
673+ continue ;
674+ }
675+
676+ txsToEvict . push ( TxHash . fromString ( txHashStr ) ) ;
677+ if ( txsToEvict . length >= limit ) {
678+ break ;
676679 }
677680 }
678- return result ;
681+
682+ return txsToEvict ;
679683 }
680684}
You can’t perform that action at this time.
0 commit comments