1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

calculate nonce based on local pending txs w/o error state.

This commit is contained in:
frankiebee 2017-06-27 15:26:04 -07:00
parent 847a4282a2
commit 0ee4502d71

View File

@ -26,7 +26,7 @@ module.exports = class TransactionController extends EventEmitter {
this.nonceTracker = new NonceTracker({ this.nonceTracker = new NonceTracker({
provider: this.provider, provider: this.provider,
blockTracker: this.provider._blockTracker, blockTracker: this.provider._blockTracker,
getPendingTransactions: (address) => this.getFilteredTxList({ from: address, status: 'submitted' }), getPendingTransactions: (address) => this.getFilteredTxList({ from: address, status: 'submitted', err: undefined }),
}) })
this.query = opts.ethQuery this.query = opts.ethQuery
this.txProviderUtils = new TxProviderUtil(this.query) this.txProviderUtils = new TxProviderUtil(this.query)
@ -263,10 +263,19 @@ module.exports = class TransactionController extends EventEmitter {
to: '0x0..', to: '0x0..',
from: '0x0..', from: '0x0..',
status: 'signed', status: 'signed',
err: undefined,
} }
and returns a list of tx with all and returns a list of tx with all
options matching options matching
****************HINT****************
| `err: undefined` is like looking |
| for a tx with no err |
| so you can also search txs that |
| dont have something as well by |
| setting the value as undefined |
************************************
this is for things like filtering a the tx list this is for things like filtering a the tx list
for only tx's from 1 account for only tx's from 1 account
or for filltering for all txs from one account or for filltering for all txs from one account