mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
wipe only transactions for current account
This commit is contained in:
parent
5f39844382
commit
03d17c75ae
@ -152,8 +152,8 @@ module.exports = class TransactionController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wipeTransactions(){
|
wipeTransactions (address) {
|
||||||
this.txStateManager.wipeTransactions();
|
this.txStateManager.wipeTransactions(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds a tx to the txlist
|
// Adds a tx to the txlist
|
||||||
|
@ -221,10 +221,16 @@ module.exports = class TransactionStateManger extends EventEmitter {
|
|||||||
this._setTxStatus(txId, 'failed')
|
this._setTxStatus(txId, 'failed')
|
||||||
}
|
}
|
||||||
|
|
||||||
wipeTransactions () {
|
wipeTransactions (address) {
|
||||||
this._saveTxList([]);
|
// network only tx
|
||||||
|
const txs = this.getTxList()
|
||||||
|
|
||||||
|
// Filter out the ones from the current account
|
||||||
|
const otherAccountTxs = txs.filter((txMeta) => txMeta.from !== address)
|
||||||
|
|
||||||
|
// Update state
|
||||||
|
this._saveTxList(otherAccountTxs)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// PRIVATE METHODS
|
// PRIVATE METHODS
|
||||||
//
|
//
|
||||||
|
@ -605,10 +605,10 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
cb(null, this.preferencesController.getSelectedAddress())
|
cb(null, this.preferencesController.getSelectedAddress())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetAccount (cb) {
|
||||||
resetAccount(cb){
|
const selectedAddress = this.preferencesController.getSelectedAddress()
|
||||||
this.txController.wipeTransactions();
|
this.txController.wipeTransactions(selectedAddress)
|
||||||
cb(null, this.preferencesController.getSelectedAddress())
|
cb(null, selectedAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user