From 70abe54c94d8c08aa1b73fd63f34b65bc3dff117 Mon Sep 17 00:00:00 2001
From: Dan <danjm.com@gmail.com>
Date: Mon, 18 Jun 2018 13:55:20 -0230
Subject: Send screen returns simple gas cost if no to address specified when
 not sending token.

---
 ui/app/components/send_/send.utils.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'ui/app/components/send_/send.utils.js')

diff --git a/ui/app/components/send_/send.utils.js b/ui/app/components/send_/send.utils.js
index 3d8e1a882..9b26b4e32 100644
--- a/ui/app/components/send_/send.utils.js
+++ b/ui/app/components/send_/send.utils.js
@@ -177,9 +177,8 @@ async function estimateGas ({ selectedAddress, selectedToken, blockGasLimit, to,
   }
 
   // if recipient has no code, gas is 21k max:
-  const hasRecipient = Boolean(to)
-  if (hasRecipient && !selectedToken) {
-    const code = await global.eth.getCode(to)
+  if (!selectedToken) {
+    const code = Boolean(to) && await global.eth.getCode(to)
     if (!code || code === '0x') {
       return SIMPLE_GAS_COST
     }
-- 
cgit