1
0

ln: some clean-up for option_scid_alias

- qt chan details dlg: show both local and remote aliases
- lnchannel: more descriptive names, add clarification in doctstrings,
  and also save the "local_scid_alias" in the wallet file (to remember if
  we sent it)
- lnpeer:
  - resend channel_ready msg after reestablish, to upgrade old existing channels
    to having local_scid_alias
  - forwarding bugfix, to follow BOLT-04:
    > - if it returns a `channel_update`:
    >   - MUST set `short_channel_id` to the `short_channel_id` used by the incoming onion.
This commit is contained in:
SomberNight
2023-06-23 19:51:57 +00:00
parent 888291a8f8
commit ca93af2b8a
4 changed files with 46 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtCore as QtCore
from PyQt5.QtWidgets import QLabel, QLineEdit, QHBoxLayout, QGridLayout
from electrum.util import EventListener
from electrum.util import EventListener, ShortID
from electrum.i18n import _
from electrum.util import format_time
from electrum.lnutil import format_short_channel_id, LOCAL, REMOTE, UpdateAddHtlc, Direction
@@ -181,9 +181,10 @@ class ChannelDetailsDialog(QtWidgets.QDialog, MessageBoxMixin, QtEventListener):
channel_id_e = ShowQRLineEdit(chan.channel_id.hex(), self.window.config, title=_("Channel ID"))
form.addRow(QLabel(_('Channel ID') + ':'), channel_id_e)
form.addRow(QLabel(_('Short Channel ID') + ':'), QLabel(str(chan.short_channel_id)))
alias = chan.get_remote_alias()
if alias:
form.addRow(QLabel(_('Alias') + ':'), QLabel('0x'+alias.hex()))
if local_scid_alias := chan.get_local_scid_alias():
form.addRow(QLabel('Local SCID Alias:'), QLabel(str(ShortID(local_scid_alias))))
if remote_scid_alias := chan.get_remote_scid_alias():
form.addRow(QLabel('Remote SCID Alias:'), QLabel(str(ShortID(remote_scid_alias))))
form.addRow(QLabel(_('State') + ':'), SelectableLabel(chan.get_state_for_GUI()))
self.capacity = self.format_sat(chan.get_capacity())
form.addRow(QLabel(_('Capacity') + ':'), SelectableLabel(self.capacity))