File tree Expand file tree Collapse file tree
packages/transaction-pool-service/source Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export class Service implements Contracts.TransactionPool.Service {
7777
7878 await this . #cleanUp( ) ;
7979
80- await this . #rebroadcastStorageTransactions ( consumedGas ) ;
80+ await this . #rebroadcastMempoolTransactions ( consumedGas ) ;
8181 } ) ;
8282 }
8383
@@ -251,7 +251,7 @@ export class Service implements Contracts.TransactionPool.Service {
251251 await this . mempool . addTransaction ( transaction ) ;
252252 }
253253
254- async #rebroadcastStorageTransactions ( consumedGas : number ) : Promise < void > {
254+ async #rebroadcastMempoolTransactions ( consumedGas : number ) : Promise < void > {
255255 const blockNumber = this . stateStore . getBlockNumber ( ) ;
256256 const milestones = this . cryptoConfiguration . getMilestone ( blockNumber ) ;
257257
@@ -267,10 +267,13 @@ export class Service implements Contracts.TransactionPool.Service {
267267 const limit = this . pluginConfiguration . getRequired < number > ( "maxTransactionsPerRequest" ) ;
268268 const broadcastTransactions : Contracts . Crypto . Transaction [ ] = [ ] ;
269269
270- // Get old transactions up to current block number.
271- for ( const { serialized } of this . storage . getOldTransactions ( blockNumber , limit ) ) {
272- const transaction = await this . transactionFactory . fromBytes ( serialized ) ;
270+ const all = await this . poolQuery . getFromHighestPriority ( ) . all ( ) ;
271+ for ( const transaction of all ) {
273272 broadcastTransactions . push ( transaction ) ;
273+
274+ if ( broadcastTransactions . length >= limit ) {
275+ break ;
276+ }
274277 }
275278
276279 if ( broadcastTransactions . length > 0 ) {
You can’t perform that action at this time.
0 commit comments