synchronizer: wait for interface
authorThomasV <thomasv@gitorious>
Mon, 2 Sep 2013 18:52:14 +0000 (20:52 +0200)
committerThomasV <thomasv@gitorious>
Mon, 2 Sep 2013 18:52:14 +0000 (20:52 +0200)
lib/blockchain.py
lib/wallet.py

index e642574..4ee95e7 100644 (file)
@@ -59,7 +59,7 @@ class BlockchainVerifier(threading.Thread):
 
     def get_new_response(self):
         # listen to interfaces, forward to verifier using the queue
-        while 1:
+        while self.is_running():
             for i in self.interfaces:
                 try:
                     r = i.get_response('verifier',timeout=0)
index 7d9f7d3..7c42dae 100644 (file)
@@ -1353,6 +1353,10 @@ class WalletSynchronizer(threading.Thread):
 
 
     def run(self):
+        if not self.interface.is_connected:
+            print_error( "synchronizer: waiting for interface")
+            self.interface.connect_event.wait()
+
         with self.lock: self.running = True
 
         requested_tx = []