do not pass unconfirmed transactions to the verifier

This commit is contained in:
ThomasV 2012-11-05 20:40:57 +01:00
parent cc028c2ca3
commit 34a6cc5dee
1 changed files with 7 additions and 6 deletions

View File

@ -542,7 +542,6 @@ class Wallet:
self.transactions[tx_hash] = d self.transactions[tx_hash] = d
self.update_tx_outputs(tx_hash) self.update_tx_outputs(tx_hash)
if self.verifier: self.verifier.add(tx_hash)
self.save() self.save()
@ -551,7 +550,9 @@ class Wallet:
with self.lock: with self.lock:
self.history[addr] = hist self.history[addr] = hist
self.save() self.save()
for tx_hash, tx_height in hist:
if tx_height>0:
self.verifier.add(tx_hash)
def get_tx_history(self): def get_tx_history(self):
@ -872,18 +873,18 @@ class Wallet:
def set_verifier(self, verifier): def set_verifier(self, verifier):
self.verifier = verifier self.verifier = verifier
for tx_hash in self.transactions.keys():
self.verifier.add(tx_hash)
# set the timestamp for transactions that need it # set the timestamp for transactions that need it
for l in self.history.values(): for hist in self.history.values():
for tx_hash, tx_height in l: for tx_hash, tx_height in hist:
tx = self.transactions.get(tx_hash) tx = self.transactions.get(tx_hash)
if tx and not tx.get('timestamp'): if tx and not tx.get('timestamp'):
timestamp = self.verifier.get_timestamp(tx_height) timestamp = self.verifier.get_timestamp(tx_height)
if timestamp: if timestamp:
self.set_tx_timestamp(tx_hash, timestamp) self.set_tx_timestamp(tx_hash, timestamp)
if tx_height>0:
self.verifier.add(tx_hash)