diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-01-19 03:42:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-19 03:42:21 +0800 |
commit | e29ed3b70becc18b6aafa430a604fe811f3fadba (patch) | |
tree | 9bf9bd4f2cf6b6591082608a9cf279c34c83346e | |
parent | 1f2840a7beff0cde617f1caf7cb7070507c81f7d (diff) | |
parent | 3b7301488f0711ea76e60b6d1bfff36f33314fb1 (diff) | |
download | tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.tar tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.tar.gz tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.tar.bz2 tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.tar.lz tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.tar.xz tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.tar.zst tangerine-wallet-browser-e29ed3b70becc18b6aafa430a604fe811f3fadba.zip |
Merge pull request #1025 from MetaMask/i1023-badTxHash
tx-manager - use rpc-specified txHash
-rw-r--r-- | app/scripts/transaction-manager.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js index 87f99ce62..9261bb54a 100644 --- a/app/scripts/transaction-manager.js +++ b/app/scripts/transaction-manager.js @@ -190,7 +190,7 @@ module.exports = class TransactionManager extends EventEmitter { let fromAddress = txParams.from let ethTx = this.txProviderUtils.buildEthTxFromParams(txParams, txMeta.gasMultiplier) this.signEthTx(ethTx, fromAddress).then(() => { - this.updateTxAsSigned(txMeta.id, ethTx) + this.setTxStatusSigned(txMeta.id) cb(null, ethUtil.bufferToHex(ethTx.serialize())) }).catch((err) => { cb(err) @@ -198,21 +198,20 @@ module.exports = class TransactionManager extends EventEmitter { } publishTransaction (txId, rawTx, cb) { - this.txProviderUtils.publishTransaction(rawTx, (err) => { + this.txProviderUtils.publishTransaction(rawTx, (err, txHash) => { if (err) return cb(err) + this.setTxHash(txId, txHash) this.setTxStatusSubmitted(txId) cb() }) } - // receives a signed tx object and updates the tx hash - updateTxAsSigned (txId, ethTx) { + // receives a txHash records the tx as signed + setTxHash (txId, txHash) { // Add the tx hash to the persisted meta-tx object - let txHash = ethUtil.bufferToHex(ethTx.hash()) let txMeta = this.getTx(txId) txMeta.hash = txHash this.updateTx(txMeta) - this.setTxStatusSigned(txMeta.id) } /* |