|
@ -20,7 +20,7 @@ |
|
|
import random, socket, ast, re, ssl |
|
|
import random, socket, ast, re, ssl |
|
|
import threading, traceback, sys, time, json, Queue |
|
|
import threading, traceback, sys, time, json, Queue |
|
|
|
|
|
|
|
|
from version import ELECTRUM_VERSION |
|
|
from version import ELECTRUM_VERSION, PROTOCOL_VERSION |
|
|
from util import print_error |
|
|
from util import print_error |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -106,7 +106,7 @@ class Interface(threading.Thread): |
|
|
if re.match("v(.?)+", v): |
|
|
if re.match("v(.?)+", v): |
|
|
version = v[1:] |
|
|
version = v[1:] |
|
|
try: |
|
|
try: |
|
|
is_recent = float(version)>=0.5 |
|
|
is_recent = float(version)>=float(PROTOCOL_VERSION) |
|
|
except: |
|
|
except: |
|
|
is_recent = False |
|
|
is_recent = False |
|
|
if ports and is_recent: |
|
|
if ports and is_recent: |
|
@ -293,7 +293,7 @@ class Interface(threading.Thread): |
|
|
|
|
|
|
|
|
if timeout: |
|
|
if timeout: |
|
|
# ping the server with server.version, as a real ping does not exist yet |
|
|
# ping the server with server.version, as a real ping does not exist yet |
|
|
self.send([('server.version', [ELECTRUM_VERSION])]) |
|
|
self.send([('server.version', [ELECTRUM_VERSION, PROTOCOL_VERSION])]) |
|
|
continue |
|
|
continue |
|
|
|
|
|
|
|
|
out += msg |
|
|
out += msg |
|
@ -388,7 +388,7 @@ class Interface(threading.Thread): |
|
|
|
|
|
|
|
|
self.connect_event.set() |
|
|
self.connect_event.set() |
|
|
if self.is_connected: |
|
|
if self.is_connected: |
|
|
self.send([('server.version', [ELECTRUM_VERSION, '0.5'])]) |
|
|
self.send([('server.version', [ELECTRUM_VERSION, PROTOCOL_VERSION])]) |
|
|
self.trigger_callback('connected') |
|
|
self.trigger_callback('connected') |
|
|
else: |
|
|
else: |
|
|
self.trigger_callback('notconnected') |
|
|
self.trigger_callback('notconnected') |
|
|