1
0

Trezor: session timeout improvements

Move session timeout from wallet to config
Prevent timeouts whenever a device operation is in progress
Move timeout job from each plugin to device manager
This commit is contained in:
Neil Booth
2016-02-10 21:51:22 +09:00
parent 7fcc881dd4
commit 5f28834bb2
8 changed files with 73 additions and 82 deletions

View File

@@ -1,7 +1,6 @@
import base64
import re
import threading
import time
from binascii import unhexlify
from functools import partial
@@ -136,8 +135,7 @@ class TrezorCompatiblePlugin(HW_PluginBase):
devmgr = self.device_manager()
client = devmgr.client_for_wallet(self, wallet, force_pair)
if client:
self.print_error("set last_operation")
wallet.last_operation = time.time()
client.used()
return client
@@ -147,9 +145,6 @@ class TrezorCompatiblePlugin(HW_PluginBase):
self.device_manager().unpair_wallet(wallet)
def initialize_device(self, wallet):
# Prevent timeouts during initialization
wallet.last_operation = self.prevent_timeout
# Initialization method
msg = _("Choose how you want to initialize your %s.\n\n"
"The first two methods are secure as no secret information "