|
|
@ -52,15 +52,33 @@ class WalletVerifier(threading.Thread): |
|
|
|
if tx in self.verified_tx: |
|
|
|
height, timestamp, pos = self.verified_tx[tx] |
|
|
|
conf = (self.local_height - height + 1) |
|
|
|
if conf <= 0: timestamp = None |
|
|
|
|
|
|
|
elif tx in self.transactions: |
|
|
|
conf = -1 |
|
|
|
timestamp = None |
|
|
|
|
|
|
|
else: |
|
|
|
conf = 0 |
|
|
|
|
|
|
|
if conf <= 0: |
|
|
|
timestamp = None |
|
|
|
|
|
|
|
return conf, timestamp |
|
|
|
|
|
|
|
|
|
|
|
def get_txpos(self, tx_hash): |
|
|
|
"return position, even if the tx is unverified" |
|
|
|
with self.lock: |
|
|
|
x = self.verified_tx.get(tx_hash) |
|
|
|
y = self.transactions.get(tx_hash) |
|
|
|
if x: |
|
|
|
height, timestamp, pos = x |
|
|
|
return height, pos |
|
|
|
elif y: |
|
|
|
return y, 0 |
|
|
|
else: |
|
|
|
return 1e12, 0 |
|
|
|
|
|
|
|
|
|
|
|
def get_height(self, tx_hash): |
|
|
|
with self.lock: |
|
|
|
v = self.verified_tx.get(tx_hash) |
|
|
|