|
|
@ -177,6 +177,7 @@ module.exports = class TransactionController extends EventEmitter { |
|
|
|
const txParams = txMeta.txParams |
|
|
|
const txParams = txMeta.txParams |
|
|
|
// ensure value
|
|
|
|
// ensure value
|
|
|
|
txMeta.gasPriceSpecified = Boolean(txParams.gasPrice) |
|
|
|
txMeta.gasPriceSpecified = Boolean(txParams.gasPrice) |
|
|
|
|
|
|
|
txMeta.nonceSpecified = Boolean(txParams.nonce) |
|
|
|
const gasPrice = txParams.gasPrice || await this.query.gasPrice() |
|
|
|
const gasPrice = txParams.gasPrice || await this.query.gasPrice() |
|
|
|
txParams.gasPrice = ethUtil.addHexPrefix(gasPrice.toString(16)) |
|
|
|
txParams.gasPrice = ethUtil.addHexPrefix(gasPrice.toString(16)) |
|
|
|
txParams.value = txParams.value || '0x0' |
|
|
|
txParams.value = txParams.value || '0x0' |
|
|
@ -200,7 +201,11 @@ module.exports = class TransactionController extends EventEmitter { |
|
|
|
// wait for a nonce
|
|
|
|
// wait for a nonce
|
|
|
|
nonceLock = await this.nonceTracker.getNonceLock(fromAddress) |
|
|
|
nonceLock = await this.nonceTracker.getNonceLock(fromAddress) |
|
|
|
// add nonce to txParams
|
|
|
|
// add nonce to txParams
|
|
|
|
|
|
|
|
if (txMeta.nonceSpecified) { |
|
|
|
|
|
|
|
txMeta.txParams.nonce = ethUtil.addHexPrefix(txMeta.txParams.nonce.toString(16)) |
|
|
|
|
|
|
|
} else { |
|
|
|
txMeta.txParams.nonce = ethUtil.addHexPrefix(nonceLock.nextNonce.toString(16)) |
|
|
|
txMeta.txParams.nonce = ethUtil.addHexPrefix(nonceLock.nextNonce.toString(16)) |
|
|
|
|
|
|
|
} |
|
|
|
// add nonce debugging information to txMeta
|
|
|
|
// add nonce debugging information to txMeta
|
|
|
|
txMeta.nonceDetails = nonceLock.nonceDetails |
|
|
|
txMeta.nonceDetails = nonceLock.nonceDetails |
|
|
|
this.txStateManager.updateTx(txMeta, 'transactions#approveTransaction') |
|
|
|
this.txStateManager.updateTx(txMeta, 'transactions#approveTransaction') |
|
|
|