"""Returns a map from tx hash to transaction height"""
with self.lock:
return self.unverified_tx.copy()
def get_unverified_tx_pending_count(self):
"""Returns the number of unverified tx's that are confirmed and are
still in process and should be verified soon."""
with self.lock:
return len([1 for height in self.unverified_tx.values() if height > 0])
def undo_verifications(self, blockchain, height):
"""Used by the verifier when a reorg has happened"""
txs = set()
with self.lock:
for tx_hash, item in list(self.verified_tx.items()):
tx_height, timestamp, pos = item
if tx_height >= height:
header = blockchain.read_header(tx_height)
# fixme: use block hash, not timestamp
if not header or header.get("timestamp") != timestamp:
self.verified_tx.pop(tx_hash, None)
txs.add(tx_hash)
if txs:
# this is probably not necessary -- as the receive_history_callback will invalidate bad cache items -- but just to be paranoid we clear the whole balance cache on reorg anyway as a safety measure
"Either method is secure since no secret information "
"will be entered into your computer."
).format(self.device)
choices = [
# Must be short as Qt doesn't word-wrap radio button text
(TIM_NEW, _("Let the device generate a completely new seed randomly")),
(TIM_RECOVER, _("Recover from a seed you have previously written down")),
]
devmgr = self.device_manager()
client = devmgr.client_by_id(device_id)
model = client.get_trezor_model()
def f(method):
loops = [
wizard.loop
] # We do it this way so as to pop the loop when it's done. This avoids possible multiple calls to loop.exit from different code paths.
handler._loops = loops # hack to prevent trezor transport errors from stalling the UI here. see clientbase.py button_request which aborts the wizard event loop on transport error