1
0

fix display of short_channel_id for channel backups

This commit is contained in:
ThomasV
2020-06-19 19:38:19 +02:00
parent ea329063bf
commit b06daaa669
3 changed files with 13 additions and 6 deletions

View File

@@ -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