File tree Expand file tree Collapse file tree
transaction-pool-api/source Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,10 +34,13 @@ export class PoolWorker implements Contracts.TransactionPool.Worker {
3434 }
3535
3636 public async getTransactions ( options : Contracts . TransactionPool . GetBatchOptions ) : Promise < Contracts . TransactionPool . GetBatchResult > {
37- return {
37+ const result = {
3838 remaining : 0 ,
3939 transactions : ( await this . poolQuery . getFromHighestPriority ( ) . all ( ) ) . map ( ( transaction ) => transaction . toData ( ) ) ,
4040 }
41+
42+ this . transactionPoolMempool . flush ( ) ;
43+ return result ;
4144 }
4245
4346 public async removeTransaction ( address : string , hash : string ) : Promise < void > {
Original file line number Diff line number Diff line change 1+ import type { Contracts } from "@mainsail/contracts" ;
2+
13import { Identifiers } from "@mainsail/constants" ;
24import { inject , injectable , tagged } from "@mainsail/container" ;
3- import type { Contracts } from "@mainsail/contracts" ;
45
56@injectable ( )
67export class Worker implements Contracts . Crypto . WorkerScriptHandler {
Original file line number Diff line number Diff line change @@ -34,10 +34,13 @@ export class PoolWorker implements Contracts.TransactionPool.Worker {
3434 }
3535
3636 public async getTransactions ( options : Contracts . TransactionPool . GetBatchOptions ) : Promise < Contracts . TransactionPool . GetBatchResult > {
37- return {
37+ const result = {
3838 remaining : 0 ,
3939 transactions : ( await this . poolQuery . getFromHighestPriority ( ) . all ( ) ) . map ( ( transaction ) => transaction . toData ( ) ) ,
4040 }
41+
42+ this . transactionPoolMempool . flush ( ) ;
43+ return result ;
4144 }
4245
4346 public async removeTransaction ( address : string , hash : string ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments