|
|
|
@ -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) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|