1
0

separate network layer from synchronizer

This commit is contained in:
ThomasV
2017-08-29 09:51:23 +02:00
parent e4659327a1
commit 5f1d9cbcf5
2 changed files with 12 additions and 8 deletions

View File

@@ -654,6 +654,13 @@ class Network(util.DaemonThread):
# Response is now in canonical form
self.process_response(interface, response, callbacks)
def subscribe_to_addresses(self, addresses, callback):
msgs = [('blockchain.address.subscribe', [x]) for x in addresses]
self.send(msgs, callback)
def request_address_history(self, address, callback):
self.send([('blockchain.address.get_history', [address])], callback)
def send(self, messages, callback):
'''Messages is a list of (method, params) tuples'''
messages = list(messages)