aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/transactions.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-01-09 05:19:18 +0800
committerkumavis <aaron@kumavis.me>2018-01-09 05:19:18 +0800
commit9a8670309d2791b212d04ee795f70040cc5f40fc (patch)
tree671db03d75b41ba318378fab6b670f146fa94ccb /app/scripts/controllers/transactions.js
parent2147b8a59a81334bf9b2d9b3fad713967db7f3c7 (diff)
downloadtangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.tar
tangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.tar.gz
tangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.tar.bz2
tangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.tar.lz
tangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.tar.xz
tangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.tar.zst
tangerine-wallet-browser-9a8670309d2791b212d04ee795f70040cc5f40fc.zip
bugfix - transactions controller - breakout logic and fix order of operations bug
Diffstat (limited to 'app/scripts/controllers/transactions.js')
-rw-r--r--app/scripts/controllers/transactions.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 469deb670..ded9739a8 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -180,8 +180,10 @@ module.exports = class TransactionController extends EventEmitter {
// ensure value
txMeta.gasPriceSpecified = Boolean(txParams.gasPrice)
txMeta.nonceSpecified = Boolean(txParams.nonce)
- const gasPrice = txParams.gasPrice || this.getGasPrice ? this.getGasPrice()
- : await this.query.gasPrice()
+ let gasPrice = txParams.gasPrice
+ if (!gasPrice) {
+ gasPrice = this.getGasPrice ? this.getGasPrice() : await this.query.gasPrice()
+ }
txParams.gasPrice = ethUtil.addHexPrefix(gasPrice.toString(16))
txParams.value = txParams.value || '0x0'
// set gasLimit