|
@ -69,11 +69,11 @@ class Interface: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def update_waiting_lists(self, method, params): |
|
|
def update_waiting_lists(self, method, params): |
|
|
if method == 'address.subscribe': |
|
|
if method == 'blockchain.address.subscribe': |
|
|
addr = params[-1] |
|
|
addr = params[-1] |
|
|
if addr in self.addresses_waiting_for_status: |
|
|
if addr in self.addresses_waiting_for_status: |
|
|
self.addresses_waiting_for_status.remove(addr) |
|
|
self.addresses_waiting_for_status.remove(addr) |
|
|
elif method == 'address.get_history': |
|
|
elif method == 'blockchain.address.get_history': |
|
|
addr = params[0] |
|
|
addr = params[0] |
|
|
if addr in self.addresses_waiting_for_history: |
|
|
if addr in self.addresses_waiting_for_history: |
|
|
self.addresses_waiting_for_history.remove(addr) |
|
|
self.addresses_waiting_for_history.remove(addr) |
|
@ -82,7 +82,7 @@ class Interface: |
|
|
def subscribe(self, addresses): |
|
|
def subscribe(self, addresses): |
|
|
messages = [] |
|
|
messages = [] |
|
|
for addr in addresses: |
|
|
for addr in addresses: |
|
|
messages.append(('address.subscribe', [addr])) |
|
|
messages.append(('blockchain.address.subscribe', [addr])) |
|
|
self.addresses_waiting_for_status.append(addr) |
|
|
self.addresses_waiting_for_status.append(addr) |
|
|
self.send(messages) |
|
|
self.send(messages) |
|
|
|
|
|
|
|
@ -111,7 +111,7 @@ class Interface: |
|
|
def start_session(self, addresses, version): |
|
|
def start_session(self, addresses, version): |
|
|
#print "Starting new session: %s:%d"%(self.host,self.port) |
|
|
#print "Starting new session: %s:%d"%(self.host,self.port) |
|
|
self.start() |
|
|
self.start() |
|
|
self.send([('client.version', [version]), ('server.banner',[]), ('numblocks.subscribe',[]), ('server.peers',[])]) |
|
|
self.send([('client.version', [version]), ('server.banner',[]), ('blockchain.numblocks.subscribe',[]), ('server.peers.subscribe',[])]) |
|
|
self.subscribe(addresses) |
|
|
self.subscribe(addresses) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -167,9 +167,9 @@ class NativeInterface(PollingInterface): |
|
|
cmds = {'session.new':'new_session', |
|
|
cmds = {'session.new':'new_session', |
|
|
'server.peers':'peers', |
|
|
'server.peers':'peers', |
|
|
'session.poll':'poll', |
|
|
'session.poll':'poll', |
|
|
'transaction.broadcast':'tx', |
|
|
'blockchain.transaction.broadcast':'tx', |
|
|
'address.get_history':'h', |
|
|
'blockchain.address.get_history':'h', |
|
|
'address.subscribe':'address.subscribe' |
|
|
'blockchain.address.subscribe':'address.subscribe' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for m in messages: |
|
|
for m in messages: |
|
|