mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
tx cont - dont recursively store history
This commit is contained in:
parent
9d69951dec
commit
7e2e4948a6
@ -119,14 +119,20 @@ module.exports = class TransactionController extends EventEmitter {
|
|||||||
|
|
||||||
//
|
//
|
||||||
updateTx (txMeta) {
|
updateTx (txMeta) {
|
||||||
|
// create txMeta snapshot for history
|
||||||
const txMetaForHistory = clone(txMeta)
|
const txMetaForHistory = clone(txMeta)
|
||||||
|
// dont include previous history in this snapshot
|
||||||
|
delete txMetaForHistory.history
|
||||||
|
// add stack to help understand why tx was updated
|
||||||
txMetaForHistory.stack = getStack()
|
txMetaForHistory.stack = getStack()
|
||||||
var txId = txMeta.id
|
// add snapshot to tx history
|
||||||
var txList = this.getFullTxList()
|
|
||||||
var index = txList.findIndex(txData => txData.id === txId)
|
|
||||||
if (!txMeta.history) txMeta.history = []
|
if (!txMeta.history) txMeta.history = []
|
||||||
txMeta.history.push(txMetaForHistory)
|
txMeta.history.push(txMetaForHistory)
|
||||||
|
|
||||||
|
// update the tx
|
||||||
|
var txId = txMeta.id
|
||||||
|
var txList = this.getFullTxList()
|
||||||
|
var index = txList.findIndex(txData => txData.id === txId)
|
||||||
txList[index] = txMeta
|
txList[index] = txMeta
|
||||||
this._saveTxList(txList)
|
this._saveTxList(txList)
|
||||||
this.emit('update')
|
this.emit('update')
|
||||||
|
Loading…
Reference in New Issue
Block a user