mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 07:51:27 +00:00
fix: add wallet types only if available
This commit is contained in:
parent
513b92f1a5
commit
395312e70f
4 changed files with 6 additions and 6 deletions
|
@ -40,7 +40,7 @@ def hook(func):
|
||||||
|
|
||||||
|
|
||||||
def run_hook(name, *args):
|
def run_hook(name, *args):
|
||||||
SPECIAL_HOOKS = ['add_wallet_types', 'get_wizard_action']
|
SPECIAL_HOOKS = ['get_wizard_action']
|
||||||
results = []
|
results = []
|
||||||
f_list = hooks.get(name,[])
|
f_list = hooks.get(name,[])
|
||||||
for p, f in f_list:
|
for p, f in f_list:
|
||||||
|
|
|
@ -1637,7 +1637,6 @@ class Wallet(object):
|
||||||
msg += "\nTo open this wallet, try 'git checkout seed_v%d'"%seed_version
|
msg += "\nTo open this wallet, try 'git checkout seed_v%d'"%seed_version
|
||||||
raise BaseException(msg)
|
raise BaseException(msg)
|
||||||
|
|
||||||
run_hook('add_wallet_types', wallet_types)
|
|
||||||
wallet_type = storage.get('wallet_type')
|
wallet_type = storage.get('wallet_type')
|
||||||
if wallet_type:
|
if wallet_type:
|
||||||
for cat, t, name, c in wallet_types:
|
for cat, t, name, c in wallet_types:
|
||||||
|
|
|
@ -45,9 +45,9 @@ class Plugin(BasePlugin):
|
||||||
def __init__(self, gui, name):
|
def __init__(self, gui, name):
|
||||||
BasePlugin.__init__(self, gui, name)
|
BasePlugin.__init__(self, gui, name)
|
||||||
self._is_available = self._init()
|
self._is_available = self._init()
|
||||||
self.wallet = None
|
self.wallet = None
|
||||||
electrum.wallet.wallet_types.append(('hardware', 'btchip', _("BTChip wallet"), BTChipWallet))
|
if self._is_available:
|
||||||
|
electrum.wallet.wallet_types.append(('hardware', 'btchip', _("BTChip wallet"), BTChipWallet))
|
||||||
|
|
||||||
def _init(self):
|
def _init(self):
|
||||||
return BTCHIP
|
return BTCHIP
|
||||||
|
|
|
@ -49,7 +49,8 @@ class Plugin(BasePlugin):
|
||||||
self._is_available = self._init()
|
self._is_available = self._init()
|
||||||
self._requires_settings = True
|
self._requires_settings = True
|
||||||
self.wallet = None
|
self.wallet = None
|
||||||
electrum.wallet.wallet_types.append(('hardware', 'trezor', _("Trezor wallet"), TrezorWallet))
|
if self._is_available:
|
||||||
|
electrum.wallet.wallet_types.append(('hardware', 'trezor', _("Trezor wallet"), TrezorWallet))
|
||||||
|
|
||||||
def _init(self):
|
def _init(self):
|
||||||
return TREZOR
|
return TREZOR
|
||||||
|
|
Loading…
Add table
Reference in a new issue