From 35878b437ac88bedbf49c17ea004885a7859aaa6 Mon Sep 17 00:00:00 2001
From: ThomasV <thomasv@electrum.org>
Date: Fri, 19 Jan 2018 15:48:20 +0100
Subject: [PATCH] network: send version first

---
 lib/network.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/network.py b/lib/network.py
index 8456ad5ab..4855c0fcb 100644
--- a/lib/network.py
+++ b/lib/network.py
@@ -306,6 +306,9 @@ class Network(util.DaemonThread):
         # Resend unanswered requests
         requests = self.unanswered_requests.values()
         self.unanswered_requests = {}
+        if self.interface.ping_required():
+            params = [ELECTRUM_VERSION, PROTOCOL_VERSION]
+            self.queue_request('server.version', params, self.interface)
         for request in requests:
             message_id = self.queue_request(request[0], request[1])
             self.unanswered_requests[message_id] = request
@@ -314,9 +317,6 @@ class Network(util.DaemonThread):
         self.queue_request('server.peers.subscribe', [])
         self.request_fee_estimates()
         self.queue_request('blockchain.relayfee', [])
-        if self.interface.ping_required():
-            params = [ELECTRUM_VERSION, PROTOCOL_VERSION]
-            self.queue_request('server.version', params, self.interface)
         for h in self.subscribed_addresses:
             self.queue_request('blockchain.scripthash.subscribe', [h])