From 88658b074edbd412048ddedaaab6333ffddae00b Mon Sep 17 00:00:00 2001
From: Peter Surda <surda@economicsofbitcoin.com>
Date: Sun, 26 Feb 2017 20:03:14 +0100
Subject: [PATCH] Socks proxy hostname resolving error handling

- if resolving fails, it wasn't handled
---
 src/protocol.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/protocol.py b/src/protocol.py
index 82edbd15..9d66ec2f 100644
--- a/src/protocol.py
+++ b/src/protocol.py
@@ -87,8 +87,12 @@ def checkSocksIP(host):
     try:
         if state.socksIP is None or not state.socksIP:
             state.socksIP = socket.gethostbyname(BMConfigParser().get("bitmessagesettings", "sockshostname"))
+    # uninitialised
     except NameError:
         state.socksIP = socket.gethostbyname(BMConfigParser().get("bitmessagesettings", "sockshostname"))
+    # resolving failure
+    except socket.gaierror:
+        state.socksIP = BMConfigParser().get("bitmessagesettings", "sockshostname")
     return state.socksIP == host
 
 def isProofOfWorkSufficient(data,