diff --git a/electrum/channel_db.py b/electrum/channel_db.py index 9ab2ed05e..0fc0bc79c 100644 --- a/electrum/channel_db.py +++ b/electrum/channel_db.py @@ -508,7 +508,6 @@ class ChannelDB(SqlDB): if l: for short_channel_id in l: self.remove_channel(short_channel_id) - self.delete_channel(short_channel_id) self.update_counts() self.logger.info(f'Deleting {len(l)} orphaned channels') @@ -524,6 +523,8 @@ class ChannelDB(SqlDB): if channel_info: self._channels_for_node[channel_info.node1_id].remove(channel_info.short_channel_id) self._channels_for_node[channel_info.node2_id].remove(channel_info.short_channel_id) + # delete from database + self.delete_channel(short_channel_id) def get_node_addresses(self, node_id): return self._addresses.get(node_id) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index f5a889591..c22327c3c 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -864,6 +864,7 @@ class LNWallet(LNWorker): short_channel_id = route[0].short_channel_id chan = self.get_channel_by_short_id(short_channel_id) if not chan: + self.channel_db.remove_channel(short_channel_id) raise Exception(f"PathFinder returned path with short_channel_id " f"{short_channel_id} that is not in channel list") self.set_payment_status(lnaddr.paymenthash, PR_INFLIGHT)