Browse Source

follow-up ImportedChannelBackup changes: fix opening wallet w/ old cbs

follow-up https://github.com/spesmilo/electrum/pull/8536

```
  1.52 | E | gui.qt.ElectrumGui |
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/__init__.py", line 342, in start_new_window
    wallet = self.daemon.load_wallet(path, None)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 469, in func_wrapper
    return func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 479, in load_wallet
    wallet = self._load_wallet(path, password, manual_upgrades=manual_upgrades, config=self.config)
  File "/home/user/wspace/electrum/electrum/util.py", line 466, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 504, in _load_wallet
    db = WalletDB(storage.read(), manual_upgrades=manual_upgrades)
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 117, in __init__
    self._after_upgrade_tasks()
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 247, in _after_upgrade_tasks
    self._load_transactions()
  File "/home/user/wspace/electrum/electrum/util.py", line 466, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/wspace/electrum/electrum/wallet_db.py", line 1536, in _load_transactions
    self.data = StoredDict(self.data, self, [])
  File "/home/user/wspace/electrum/electrum/json_db.py", line 117, in __init__
    self.__setitem__(k, v)
  File "/home/user/wspace/electrum/electrum/json_db.py", line 49, in wrapper
    return func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/json_db.py", line 135, in __setitem__
    v = self.db._convert_dict(self.path, key, v)
  File "/home/user/wspace/electrum/electrum/json_db.py", line 247, in _convert_dict
    v = dict((k, constructor(**x)) for k, x in v.items())
  File "/home/user/wspace/electrum/electrum/json_db.py", line 247, in <genexpr>
    v = dict((k, constructor(**x)) for k, x in v.items())
TypeError: ImportedChannelBackupStorage.__init__() missing 1 required positional argument: 'local_payment_pubkey'
```
master
SomberNight 2 years ago
parent
commit
69336befee
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/lnutil.py

2
electrum/lnutil.py

@ -279,7 +279,7 @@ class ImportedChannelBackupStorage(ChannelBackupStorage):
remote_delay = attr.ib(type=int, converter=int)
remote_payment_pubkey = attr.ib(type=bytes, converter=hex_to_bytes)
remote_revocation_pubkey = attr.ib(type=bytes, converter=hex_to_bytes)
local_payment_pubkey = attr.ib(type=bytes, converter=hex_to_bytes) # type: Optional[bytes]
local_payment_pubkey = attr.ib(type=bytes, converter=hex_to_bytes, default=None) # type: Optional[bytes]
def to_bytes(self) -> bytes:
vds = BCDataStream()

Loading…
Cancel
Save