app/scripts/transaction-manager.js
// Adds a tx to the txlist
Adds a tx to the txlist
Adds a tx to the txlist
addTx (txMeta) {
    var txList = this.getTxList()
    var txHistoryLimit = this.txHistoryLimit
    if (txList.length > txHistoryLimit - 1) {
      var index = txList.findIndex((metaTx) => metaTx.status === 'confirmed' || metaTx.status === 'rejected')
      txList.splice(index, 1)
    }
    txList.push(txMeta)
    this._saveTxList(txList)
    this.once(`${txMeta.id}:signed`, function (txId) {
      this.removeAllListeners(`${txMeta.id}:rejected`)
    })
    this.once(`${txMeta.id}:rejected`, function (txId) {
      this.removeAllListeners(`${txMeta.id}:signed`)
    })
    this.emit('updateBadge')
    this.emit(`${txMeta.id}:unapproved`, txMeta)
  }
addTx ( txMeta ) { var txList = this . getTxList ( ) var txHistoryLimit = this . txHistoryLimit if ( txList . length > txHistoryLimit - 1 ) { var index = txList . findIndex ( ( metaTx ) => metaTx . status === 'confirmed' || metaTx . status === 'rejected' ) txList . splice ( index , 1 ) } txList . push ( txMeta ) this . _saveTxList ( txList ) this . once ( ` ${ txMeta . id } ` , function ( txId ) { this . removeAllListeners ( ` ${ txMeta . id } ` ) } ) this . once ( ` ${ txMeta . id } ` , function ( txId ) { this . removeAllListeners ( ` ${ txMeta . id } ` ) } ) this . emit ( 'updateBadge' ) this . emit ( ` ${ txMeta . id } ` , txMeta ) }
Adds a tx to the txlist
Adds a tx to the txlist
// checks if the length of th tx history is // longer then desired persistence limit // and then if it is removes only confirmed // or rejected tx's. // not tx's that are pending or unapproved