fix callbacks
This commit is contained in:
@@ -323,6 +323,8 @@ class Network(threading.Thread):
|
||||
self.on_peers(i, response)
|
||||
elif method == 'server.banner':
|
||||
self.on_banner(i, response)
|
||||
else:
|
||||
self.response_queue.put(response)
|
||||
|
||||
def process_requests_thread(self):
|
||||
while self.is_running():
|
||||
|
||||
@@ -103,7 +103,7 @@ class WalletSynchronizer(threading.Thread):
|
||||
# request missing transactions
|
||||
for tx_hash, tx_height in missing_tx:
|
||||
if (tx_hash, tx_height) not in requested_tx:
|
||||
self.network.send([ ('blockchain.transaction.get',[tx_hash, tx_height]) ], lambda i,r: self.queue.put(r))
|
||||
self.network.send([ ('blockchain.transaction.get',[tx_hash, tx_height]) ], self.queue.put)
|
||||
requested_tx.append( (tx_hash, tx_height) )
|
||||
missing_tx = []
|
||||
|
||||
|
||||
@@ -103,10 +103,10 @@ class TxVerifier(threading.Thread):
|
||||
for tx_hash, tx_height in self.transactions.items():
|
||||
if tx_hash not in self.verified_tx:
|
||||
# do not request merkle branch before headers are available
|
||||
if tx_height > self.network.blockchain.height():
|
||||
if tx_height > self.network.get_local_height():
|
||||
continue
|
||||
if self.merkle_roots.get(tx_hash) is None and tx_hash not in requested_merkle:
|
||||
if self.network.send([ ('blockchain.transaction.get_merkle',[tx_hash, tx_height]) ], lambda i,r: self.queue.put(r)):
|
||||
if self.network.send([ ('blockchain.transaction.get_merkle',[tx_hash, tx_height]) ], self.queue.put):
|
||||
print_error('requesting merkle', tx_hash)
|
||||
requested_merkle.append(tx_hash)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user