mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Stop removing old shapeshift txs
This commit is contained in:
parent
af439cc6cf
commit
89bbccb09c
@ -4,9 +4,6 @@ const extend = require('xtend')
|
||||
// every three seconds when an incomplete tx is waiting
|
||||
const POLLING_INTERVAL = 3000
|
||||
|
||||
// drop txs that haven't been paid to in 11 mins
|
||||
const TIMEOUT_LIMIT = 660000
|
||||
|
||||
class ShapeshiftController {
|
||||
|
||||
constructor (opts = {}) {
|
||||
@ -27,24 +24,11 @@ class ShapeshiftController {
|
||||
}
|
||||
|
||||
getPendingTxs () {
|
||||
this.removeOldTxs()
|
||||
const txs = this.getShapeShiftTxList()
|
||||
const pending = txs.filter(tx => tx.response && tx.response.status !== 'complete')
|
||||
return pending
|
||||
}
|
||||
|
||||
removeOldTxs() {
|
||||
const { shapeShiftTxList } = this.store.getState()
|
||||
const now = new Date().getTime()
|
||||
const old = shapeShiftTxList.find((tx) => {
|
||||
return tx.time + TIMEOUT_LIMIT < now &&
|
||||
tx.response && tx.response.status === 'no_deposits'
|
||||
})
|
||||
if (old) {
|
||||
old.forEach(tx => this.removeShapeShiftTx(tx))
|
||||
}
|
||||
}
|
||||
|
||||
pollForUpdates () {
|
||||
const pendingTxs = this.getPendingTxs()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user