channels_list: show backup text in the state column. fix missing import in previous commit.
This commit is contained in:
@@ -55,7 +55,7 @@ from electrum import (keystore, ecc, constants, util, bitcoin, commands,
|
|||||||
from electrum.bitcoin import COIN, is_address
|
from electrum.bitcoin import COIN, is_address
|
||||||
from electrum.plugin import run_hook, BasePlugin
|
from electrum.plugin import run_hook, BasePlugin
|
||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
from electrum.util import (format_time,
|
from electrum.util import (format_time, get_backup_dir,
|
||||||
UserCancelled, profiler,
|
UserCancelled, profiler,
|
||||||
bh2u, bfh, InvalidPassword,
|
bh2u, bfh, InvalidPassword,
|
||||||
UserFacingException,
|
UserFacingException,
|
||||||
@@ -628,7 +628,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||||||
if not d.exec_():
|
if not d.exec_():
|
||||||
return False
|
return False
|
||||||
backup_dir = get_backup_dir(self.config)
|
backup_dir = get_backup_dir(self.config)
|
||||||
if backup_dir is not None:
|
if backup_dir is None:
|
||||||
self.show_message(_("You need to configure a backup directory in your preferences"), title=_("Backup not configured"))
|
self.show_message(_("You need to configure a backup directory in your preferences"), title=_("Backup not configured"))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -479,17 +479,9 @@ class ChannelBackup(AbstractChannel):
|
|||||||
def is_initiator(self):
|
def is_initiator(self):
|
||||||
return self.cb.is_initiator
|
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):
|
def get_state_for_GUI(self):
|
||||||
if self.lnworker:
|
cs = self.get_state()
|
||||||
return self.lnworker.lnwatcher.get_channel_status(self.funding_outpoint.to_str())
|
return 'BACKUP' + ', '+ cs.name
|
||||||
else:
|
|
||||||
return 'unknown'
|
|
||||||
|
|
||||||
def get_oldest_unrevoked_ctn(self, who):
|
def get_oldest_unrevoked_ctn(self, who):
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
Reference in New Issue
Block a user