save list of verified tx only when needed

This commit is contained in:
thomasv 2012-10-22 15:44:54 +02:00
parent 10d6db468a
commit af0d8d664b
1 changed files with 3 additions and 2 deletions

View File

@ -951,7 +951,7 @@ class WalletVerifier(threading.Thread):
self.merkle_roots = config.get('merkle_roots',{})
self.headers = config.get('block_headers',{})
self.lock = threading.Lock()
self.saved = False
self.saved = True
def run(self):
requested = []
@ -964,13 +964,14 @@ class WalletVerifier(threading.Thread):
if tx not in requested:
requested.append(tx)
self.request_merkle(tx)
self.saved = False
break
try:
r = self.interface.get_response('verifier',timeout=1)
except Queue.Empty:
if len(self.validated) == len(txlist) and not self.saved:
print "verified %d transactions"%len(txlist)
print "saving verified transactions"
self.config.set_key('verified_tx', self.validated, True)
self.saved = True
continue