diff --git a/packages/core-interfaces/src/core-transaction-pool/transaction-pool.ts b/packages/core-interfaces/src/core-transaction-pool/transaction-pool.ts index ea97265696..072e1b2eaf 100644 --- a/packages/core-interfaces/src/core-transaction-pool/transaction-pool.ts +++ b/packages/core-interfaces/src/core-transaction-pool/transaction-pool.ts @@ -85,7 +85,7 @@ export interface ITransactionPool { * Get all transactions within the specified range [start, start + size), ordered by fee. * @return {(Array|void)} array of serialized transaction hex strings */ - getTransactions(start: number, size: number, maxBytes: number): string[]; + getTransactions(start: number, size: number, maxBytes?: number): string[]; /** * Get all transactions within the specified range [start, start + size). @@ -99,7 +99,7 @@ export interface ITransactionPool { * insertion time, if fees equal (earliest transaction first). * @return {Array} array of transaction[property] */ - getTransactionsData(start: number, size: number, property: string, maxBytes: number): any[]; + getTransactionsData(start: number, size: number, property: string, maxBytes?: number): any[]; /** * Remove all transactions from the transaction pool belonging to specific sender. diff --git a/packages/core-transaction-pool/src/connection.ts b/packages/core-transaction-pool/src/connection.ts index 4433408025..4baa937702 100644 --- a/packages/core-transaction-pool/src/connection.ts +++ b/packages/core-transaction-pool/src/connection.ts @@ -242,7 +242,7 @@ export class TransactionPool implements transactionPool.ITransactionPool { * @param {Number} maxBytes for the total transaction array or 0 for no limit * @return {(Array|void)} array of serialized transaction hex strings */ - public getTransactions(start, size, maxBytes) { + public getTransactions(start, size, maxBytes?: number) { return this.getTransactionsData(start, size, "serialized", maxBytes); } @@ -266,7 +266,7 @@ export class TransactionPool implements transactionPool.ITransactionPool { * @param {String} property * @return {Array} array of transaction[property] */ - public getTransactionsData(start, size, property, maxBytes) { + public getTransactionsData(start, size, property, maxBytes = 0) { this.__purgeExpired(); const data = [];