Skip to content

Conversation

@bitromortac
Copy link
Contributor

@bitromortac bitromortac commented Jan 19, 2022

Spec: lightning/bolts#880

This PR adds a TLV to open_channel and accept_channel messages. The initiator checks the peer's node features and selects a channel type that is supported by both peers, which signals the type of the channel to be opened explicitly. This lets us remove the static_remotekey_enabled field in the storage, which is now a IntFlag (ChannelType).

This should also be applied to #7509.

Tests:

  • open channel with legacy node (testnet)
  • open channel with node supporting option_channel_type (testnet)

* channel_type is put into storage, serialized as int and
  deserialized as ChannelType
* check for static_remotekey is done via channel type
@ecdsa
Copy link
Member

ecdsa commented Feb 21, 2022

looks good to me.

@ecdsa ecdsa merged commit b268877 into spesmilo:master Feb 21, 2022
SomberNight added a commit that referenced this pull request Feb 25, 2022
I still have a mainnet wallet with some pre-static-remotekey channels
(though those channels are closed) that I do not want to delete yet.

follow-up #7636

```
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\__init__.py", line 307, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\gui\qt\__init__.py", line 332, in start_new_window
    wallet = self._start_wizard_to_select_or_create_wallet(path)
  File "...\electrum\electrum\gui\qt\__init__.py", line 377, in _start_wizard_to_select_or_create_wallet
    db = WalletDB(storage.read(), manual_upgrades=False)
  File "...\electrum\electrum\wallet_db.py", line 73, in __init__
    self.load_data(raw)
  File "...\electrum\electrum\wallet_db.py", line 106, in load_data
    self.upgrade()
  File "...\electrum\electrum\util.py", line 439, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "...\electrum\electrum\util.py", line 435, in do_profile
    o = func(*args, **kw_args)
  File "...\electrum\electrum\wallet_db.py", line 195, in upgrade
    self._convert_version_44()
  File "...\electrum\electrum\wallet_db.py", line 859, in _convert_version_44
    if item['static_remotekey_enabled']:
KeyError: 'static_remotekey_enabled'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants