commit fe142452e2faf4c09218686cd90202ed83d6488a
parent 29072ef1ad65ea4072af6b7fade1e54f24ec084b
Author: ThomasV <thomasv@gitorious>
Date: Wed, 28 Mar 2012 14:22:46 +0200
minor fixes
Diffstat:
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/client/interface.py b/client/interface.py
@@ -58,7 +58,7 @@ class Interface:
try:
method = c['method']
except:
- print "error"
+ print "error", c
return
if error:
@@ -226,7 +226,8 @@ class HttpInterface(PollingInterface):
thread.start_new_thread(self.poll_thread, (15,))
def poll(self):
- self.send( [] )
+ if self.session_id:
+ self.send( [] )
def send(self, messages):
import urllib2, json, time, cookielib
diff --git a/client/wallet.py b/client/wallet.py
@@ -270,11 +270,12 @@ class Wallet:
self.imported_keys = {}
self.remote_url = None
- self.was_updated = False
+ self.was_updated = True
self.blocks = 0
self.banner = ''
self.up_to_date_event = threading.Event()
self.up_to_date_event.clear()
+ self.up_to_date = False
self.interface_lock = threading.Lock()
self.tx_event = threading.Event()
@@ -967,7 +968,8 @@ class Wallet:
def run(self):
while self.interface.is_connected:
new_addresses = self.synchronize()
- self.interface.subscribe(new_addresses)
+ if new_addresses:
+ self.interface.subscribe(new_addresses)
if self.interface.is_up_to_date() and not new_addresses:
self.up_to_date = True
self.up_to_date_event.set()