From f3d1f71e94f3f4e70776352ac1ad889e0bc45e2f Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 22 Oct 2018 15:05:58 +0200 Subject: [PATCH] lnchan: set diagnostic_name previously was only set for tests --- electrum/lnchan.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/electrum/lnchan.py b/electrum/lnchan.py index c0713d2d3..798d2485b 100644 --- a/electrum/lnchan.py +++ b/electrum/lnchan.py @@ -93,7 +93,12 @@ def str_bytes_dict_to_save(x): class Channel(PrintError): def diagnostic_name(self): - return str(self.name) + if self.name: + return str(self.name) + try: + return f"lnchan_{bh2u(self.channel_id[-4:])}" + except: + return super().diagnostic_name() def __init__(self, state, name = None): assert 'local_state' not in state