PROTOCOL_VERSION
This commit is contained in:
parent
8f85187545
commit
8ed812830f
|
@ -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,8 +106,8 @@ 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:
|
||||||
servers.append((host, ports))
|
servers.append((host, ports))
|
||||||
|
@ -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')
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
ELECTRUM_VERSION = "1.3"
|
ELECTRUM_VERSION = "1.3" # version of the client package
|
||||||
SEED_VERSION = 4 # bump this everytime the seed generation is modified
|
PROTOCOL_VERSION = '0.5' # protocol version requested
|
||||||
TRANSLATION_ID = 32150 # version of the wiki page
|
SEED_VERSION = 4 # bump this everytime the seed generation is modified
|
||||||
|
TRANSLATION_ID = 32150 # version of the wiki page
|
||||||
|
|
|
@ -9,9 +9,9 @@ except:
|
||||||
print "usage: get_history <bitcoin_address>"
|
print "usage: get_history <bitcoin_address>"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
i = Interface({'server':'electrum.novit.ro:50001:t'})
|
i = Interface({'server':'webbtc.com:50001:t'})
|
||||||
i.start()
|
i.start()
|
||||||
h = i.synchronous_get([ ('blockchain.address.get_history',[addr]) ])[0]
|
h = i.synchronous_get([ ('blockchain.address.get_history',[addr]) ])[0]
|
||||||
for item in h:
|
for item in h:
|
||||||
print item['tx_hash'], item['value']
|
print item['tx_hash'], item['height']
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue