aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-06-15 07:14:55 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-06-15 08:43:04 +0800
commit6ae97290f0e744479a41e31507f79309137d94c0 (patch)
treefd7ed75457928039303d02980bd8fddd967557c3 /app
parent56490c6468bb83dccf04941ded5fec1017e5fe2c (diff)
downloadtangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.tar
tangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.tar.gz
tangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.tar.bz2
tangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.tar.lz
tangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.tar.xz
tangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.tar.zst
tangerine-wallet-browser-6ae97290f0e744479a41e31507f79309137d94c0.zip
check for the tx in the block that provider engine gives us
Diffstat (limited to 'app')
-rw-r--r--app/scripts/controllers/transactions.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 2db8041eb..71f90c2cd 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -338,12 +338,13 @@ module.exports = class TransactionController extends EventEmitter {
// checks if a signed tx is in a block and
// if included sets the tx status as 'confirmed'
- checkForTxInBlock () {
+ checkForTxInBlock (block) {
var signedTxList = this.getFilteredTxList({status: 'submitted'})
if (!signedTxList.length) return
signedTxList.forEach((txMeta) => {
var txHash = txMeta.hash
var txId = txMeta.id
+
if (!txHash) {
const errReason = {
errCode: 'No hash was provided',
@@ -351,20 +352,9 @@ module.exports = class TransactionController extends EventEmitter {
}
return this.setTxStatusFailed(txId, errReason)
}
- this.query.getTransactionByHash(txHash, (err, txParams) => {
- if (err || !txParams) {
- if (!txParams) return
- txMeta.err = {
- isWarning: true,
- errorCode: err,
- message: 'There was a problem loading this transaction.',
- }
- this.updateTx(txMeta)
- return log.error(err)
- }
- if (txParams.blockNumber) {
- this.setTxStatusConfirmed(txId)
- }
+
+ block.transactions.forEach((tx) => {
+ if (tx.hash === txHash) this.setTxStatusConfirmed(txId)
})
})
}