Fix the inclusion of the txFee in the meta tx object

feature/default_network_editable
Frankie 8 years ago
parent 87505e1742
commit fdcf03f57d
  1. 8
      app/scripts/transaction-manager.js

@ -125,7 +125,6 @@ module.exports = class TransactionManager extends EventEmitter {
setMaxTxCostAndFee (txMeta) { setMaxTxCostAndFee (txMeta) {
var txParams = txMeta.txParams var txParams = txMeta.txParams
var gasMultiplier = txMeta.gasMultiplier var gasMultiplier = txMeta.gasMultiplier
var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txMeta.estimatedGas), 16) var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txMeta.estimatedGas), 16)
var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16) var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16)
@ -133,6 +132,7 @@ module.exports = class TransactionManager extends EventEmitter {
var txFee = gasCost.mul(gasPrice) var txFee = gasCost.mul(gasPrice)
var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16) var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16)
var maxCost = txValue.add(txFee) var maxCost = txValue.add(txFee)
txMeta.txFee = txFee
txMeta.txValue = txValue txMeta.txValue = txValue
txMeta.maxCost = maxCost txMeta.maxCost = maxCost
this.updateTx(txMeta) this.updateTx(txMeta)
@ -160,8 +160,10 @@ module.exports = class TransactionManager extends EventEmitter {
(rawTx, cb) => self.publishTransaction(txId, rawTx, cb), (rawTx, cb) => self.publishTransaction(txId, rawTx, cb),
], (err) => { ], (err) => {
self.nonceLock.leave() self.nonceLock.leave()
this.setTxStatusFailed(txId) if (err) {
if (err) return cb(err) this.setTxStatusFailed(txId)
return cb(err)
}
cb() cb()
}) })
}) })

Loading…
Cancel
Save