diff --git a/client/blocks b/client/blocks index 7971b1c71..f5567ee98 100755 --- a/client/blocks +++ b/client/blocks @@ -2,11 +2,9 @@ import socket, time, interface -def cb(block_number): - print block_number - -i = interface.AsynchronousInterface('ecdsa.org', 50001, newblock_callback=cb) +i = interface.AsynchronousInterface('ecdsa.org', 50001) i.start_session([],"blocks") while True: - time.sleep(1) + r = i.responses.get(True, 100000000000) + if r.get('method')=='numblocks.subscribe': print r.get('result') diff --git a/client/wallet.py b/client/wallet.py index 806dbaa8b..bdaa7f7e2 100644 --- a/client/wallet.py +++ b/client/wallet.py @@ -974,7 +974,7 @@ class Wallet: else: self.up_to_date = False - response = self.interface.responses.get() + response = self.interface.responses.get(True,100000000000) # workaround so that it can be keyboard interrupted self.handle_response(response) def start_interface(self):