1
0

do not request merkle root for unconfirmed transactions

This commit is contained in:
thomasv
2012-10-29 09:31:42 +01:00
parent ea7dabe640
commit cdb52c30d2
3 changed files with 11 additions and 9 deletions

View File

@@ -46,8 +46,10 @@ class WalletVerifier(threading.Thread):
def get_confirmations(self, tx):
""" return the number of confirmations of a monitored transaction. """
with self.lock:
assert tx in self.transactions
return (self.local_height - self.verified_tx[tx] + 1) if tx in self.verified_tx else 0
if tx in self.transactions:
return (self.local_height - self.verified_tx[tx] + 1) if tx in self.verified_tx else 0
else:
return 0
def add(self, tx):
""" add a transaction to the list of monitored transactions. """