mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
Rename method to reflect its goal
Answer the question *what* problem the method solves. Not *how* it is solving it.
This commit is contained in:
parent
d0d39e534e
commit
812d570ee2
1 changed files with 3 additions and 3 deletions
|
@ -625,7 +625,7 @@ class Network(util.DaemonThread):
|
||||||
# Response is now in canonical form
|
# Response is now in canonical form
|
||||||
self.process_response(interface, response, callbacks)
|
self.process_response(interface, response, callbacks)
|
||||||
|
|
||||||
def overload_cb(self, callback):
|
def map_scripthash_to_address(self, callback):
|
||||||
def cb2(x):
|
def cb2(x):
|
||||||
x2 = x.copy()
|
x2 = x.copy()
|
||||||
p = x2.pop('params')
|
p = x2.pop('params')
|
||||||
|
@ -638,12 +638,12 @@ class Network(util.DaemonThread):
|
||||||
hash2address = {bitcoin.address_to_scripthash(address): address for address in addresses}
|
hash2address = {bitcoin.address_to_scripthash(address): address for address in addresses}
|
||||||
self.h2addr.update(hash2address)
|
self.h2addr.update(hash2address)
|
||||||
msgs = [('blockchain.scripthash.subscribe', [x]) for x in hash2address.keys()]
|
msgs = [('blockchain.scripthash.subscribe', [x]) for x in hash2address.keys()]
|
||||||
self.send(msgs, self.overload_cb(callback))
|
self.send(msgs, self.map_scripthash_to_address(callback))
|
||||||
|
|
||||||
def request_address_history(self, address, callback):
|
def request_address_history(self, address, callback):
|
||||||
h = bitcoin.address_to_scripthash(address)
|
h = bitcoin.address_to_scripthash(address)
|
||||||
self.h2addr.update({h: address})
|
self.h2addr.update({h: address})
|
||||||
self.send([('blockchain.scripthash.get_history', [h])], self.overload_cb(callback))
|
self.send([('blockchain.scripthash.get_history', [h])], self.map_scripthash_to_address(callback))
|
||||||
|
|
||||||
def send(self, messages, callback):
|
def send(self, messages, callback):
|
||||||
'''Messages is a list of (method, params) tuples'''
|
'''Messages is a list of (method, params) tuples'''
|
||||||
|
|
Loading…
Add table
Reference in a new issue