aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2018-04-03 06:43:32 +0800
committerfrankiebee <frankie.diamond@gmail.com>2018-04-03 06:43:32 +0800
commitab126b8c7894a0cfb8e728eeed48689200ed7a6c (patch)
treee57ac7ea58ae03f9ad6b5cabe39da01d39db4a2d /app/scripts/lib
parente8a480aac44546e6bd5d7457545bc951a8787814 (diff)
downloadtangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.tar
tangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.tar.gz
tangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.tar.bz2
tangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.tar.lz
tangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.tar.xz
tangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.tar.zst
tangerine-wallet-browser-ab126b8c7894a0cfb8e728eeed48689200ed7a6c.zip
transactions gasLimit - use the block gasLimit if getCode fails
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/tx-gas-utils.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/scripts/lib/tx-gas-utils.js b/app/scripts/lib/tx-gas-utils.js
index 4be7738b0..829b4c421 100644
--- a/app/scripts/lib/tx-gas-utils.js
+++ b/app/scripts/lib/tx-gas-utils.js
@@ -52,7 +52,9 @@ module.exports = class TxGasUtil {
// if recipient has no code, gas is 21k max:
const recipient = txParams.to
const hasRecipient = Boolean(recipient)
- const code = await this.query.getCode(recipient)
+ let code
+ if (recipient) code = await this.query.getCode(recipient)
+
if (hasRecipient && (!code || code === '0x')) {
txParams.gas = SIMPLE_GAS_COST
txMeta.simpleSend = true // Prevents buffer addition