From e8b2e11c5624d80f535c1344d9c9be48627b1319 Mon Sep 17 00:00:00 2001 From: Frankie Date: Mon, 21 May 2018 16:00:44 -0700 Subject: Reveal get filtered tx list (#4332) * add getFilteredTxList from txController to getApi * transactions - remove dead code (isNonceTaken) --- app/scripts/controllers/transactions/index.js | 15 --------------- app/scripts/metamask-controller.js | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) (limited to 'app') diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 3886db104..541f1db73 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -111,21 +111,6 @@ class TransactionController extends EventEmitter { this.txStateManager.wipeTransactions(address) } - /** - Check if a txMeta in the list with the same nonce has been confirmed in a block - if the txParams dont have a nonce will return false - @returns {boolean} whether the nonce has been used in a transaction confirmed in a block - @param {object} txMeta - the txMeta object - */ - async isNonceTaken (txMeta) { - const { from, nonce } = txMeta.txParams - if ('nonce' in txMeta.txParams) { - const sameNonceTxList = this.txStateManager.getFilteredTxList({from, nonce, status: 'confirmed'}) - return (sameNonceTxList.length >= 1) - } - return false - } - /** add a new unapproved transaction to the pipeline diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 807c9a0b9..1b1d26886 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -382,7 +382,7 @@ module.exports = class MetamaskController extends EventEmitter { updateTransaction: nodeify(txController.updateTransaction, txController), updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController), retryTransaction: nodeify(this.retryTransaction, this), - isNonceTaken: nodeify(txController.isNonceTaken, txController), + getFilteredTxList: nodeify(txController.getFilteredTxList, txController), // messageManager signMessage: nodeify(this.signMessage, this), -- cgit v1.2.3