aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-05 02:20:52 +0800
committerDan <danjm.com@gmail.com>2018-06-05 02:20:52 +0800
commitada59054c9d102cc99b950f1377256cac5545649 (patch)
tree4e184b7dc5f97d9d4da28e6b72b256e955b0a937 /ui
parentffd42c59da1e3728786d8e8cd20a9c95ea279de0 (diff)
downloadtangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.tar
tangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.tar.gz
tangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.tar.bz2
tangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.tar.lz
tangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.tar.xz
tangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.tar.zst
tangerine-wallet-browser-ada59054c9d102cc99b950f1377256cac5545649.zip
Simplify recipient code check in send.utils estimateGas
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/send_/send.utils.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/app/components/send_/send.utils.js b/ui/app/components/send_/send.utils.js
index 855d12303..67699be77 100644
--- a/ui/app/components/send_/send.utils.js
+++ b/ui/app/components/send_/send.utils.js
@@ -176,10 +176,11 @@ async function estimateGas ({ selectedAddress, selectedToken, blockGasLimit, to,
// if recipient has no code, gas is 21k max:
const hasRecipient = Boolean(to)
- let code
- if (hasRecipient) code = await global.eth.getCode(to)
- if (hasRecipient && (!code || code === '0x') && !selectedToken) {
- return SIMPLE_GAS_COST
+ if (hasRecipient && !selectedToken) {
+ const code = await global.eth.getCode(to)
+ if (!code || code === '0x') {
+ return SIMPLE_GAS_COST
+ }
}
paramsForGasEstimate.to = selectedToken ? selectedToken.address : to