Browse Source

fix display of short_channel_id for channel backups

bip39-recovery
ThomasV 5 years ago
parent
commit
b06daaa669
  1. 6
      electrum/gui/qt/channels_list.py
  2. 11
      electrum/lnchannel.py
  3. 2
      electrum/lnworker.py

6
electrum/gui/qt/channels_list.py

@ -209,9 +209,6 @@ class ChannelsList(MyTreeView):
def do_update_single_row(self, wallet: Abstract_Wallet, chan: AbstractChannel):
if wallet != self.parent.wallet:
return
lnworker = wallet.lnworker
if not lnworker:
return
for row in range(self.model().rowCount()):
item = self.model().item(row, self.Columns.NODE_ALIAS)
if item.data(ROLE_CHANNEL_ID) != chan.channel_id:
@ -220,7 +217,8 @@ class ChannelsList(MyTreeView):
self.model().item(row, column).setData(v, QtCore.Qt.DisplayRole)
items = [self.model().item(row, column) for column in self.Columns]
self._update_chan_frozen_bg(chan=chan, items=items)
self.update_can_send(lnworker)
if wallet.lnworker:
self.update_can_send(wallet.lnworker)
@QtCore.pyqtSlot()
def on_gossip_db(self):

11
electrum/lnchannel.py

@ -293,6 +293,9 @@ class AbstractChannel(Logger, ABC):
closing_txid: str, closing_height: TxMinedInfo, keep_watching: bool) -> None:
self.save_funding_height(txid=funding_txid, height=funding_height.height, timestamp=funding_height.timestamp)
self.save_closing_height(txid=closing_txid, height=closing_height.height, timestamp=closing_height.timestamp)
if funding_height.conf>0:
self.set_short_channel_id(ShortChannelID.from_components(
funding_height.height, funding_height.txpos, self.funding_outpoint.output_index))
if self.get_state() < ChannelState.CLOSED:
conf = closing_height.conf
if conf > 0:
@ -435,9 +438,15 @@ class ChannelBackup(AbstractChannel):
def is_initiator(self):
return self.cb.is_initiator
def short_id_for_GUI(self) -> str:
if self.short_channel_id:
return 'BACKUP of ' + format_short_channel_id(self.short_channel_id)
else:
return 'BACKUP'
def get_state_for_GUI(self):
cs = self.get_state()
return 'BACKUP, ' + cs.name
return cs.name
def get_oldest_unrevoked_ctn(self, who):
return -1

2
electrum/lnworker.py

@ -1436,7 +1436,7 @@ class LNBackups(Logger):
pass
async def on_channel_update(self, chan):
pass
util.trigger_callback('channel', self.wallet, chan)
def channel_by_txo(self, txo):
with self.lock:

Loading…
Cancel
Save