minor fixes

This commit is contained in:
ThomasV 2012-03-28 14:22:46 +02:00
parent 29072ef1ad
commit fe142452e2
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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()