commit 2d3c2eeea9c225af2ec2d1654363c4b75c5b1158
parent e53ce5dee0694cbde0a5b28fca7a59e9ea19d83a
Author: SomberNight <somber.night@protonmail.com>
Date: Wed, 1 Apr 2020 13:31:49 +0200
keystore: add workaround for StoredDict issue #6066
note: not a proper fix... but works for now
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/electrum/keystore.py b/electrum/keystore.py
@@ -49,6 +49,7 @@ from .logging import Logger
if TYPE_CHECKING:
from .gui.qt.util import TaskThread
from .plugins.hw_wallet import HW_PluginBase, HardwareClientBase, HardwareHandlerBase
+ from .wallet_db import WalletDB
class KeyStore(Logger, ABC):
@@ -886,8 +887,9 @@ def hardware_keystore(d) -> Hardware_KeyStore:
raise WalletFileException(f'unknown hardware type: {hw_type}. '
f'hw_keystores: {list(hw_keystores)}')
-def load_keystore(db, name) -> KeyStore:
+def load_keystore(db: 'WalletDB', name: str) -> KeyStore:
d = db.get(name, {})
+ d = dict(d) # convert to dict from StoredDict (see #6066)
t = d.get('type')
if not t:
raise WalletFileException(
diff --git a/electrum/plugins/ledger/ledger.py b/electrum/plugins/ledger/ledger.py
@@ -229,6 +229,7 @@ class Ledger_KeyStore(Hardware_KeyStore):
self.force_watching_only = False
self.signing = False
self.cfg = d.get('cfg', {'mode': 0})
+ self.cfg = dict(self.cfg) # convert to dict from StoredDict (see #6066)
def dump(self):
obj = Hardware_KeyStore.dump(self)