From 375f96f7fad0580a678fbc8fdf9be746eda82fae Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 17 Sep 2023 11:06:25 +0200 Subject: [PATCH] remove lnworker.get_channel_by_scid (redundant) --- electrum/commands.py | 4 ++-- electrum/lnworker.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/electrum/commands.py b/electrum/commands.py index e75edf025..4ce345f9a 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -1282,8 +1282,8 @@ class Commands: from .lnutil import ShortChannelID from_scid = ShortChannelID.from_str(from_scid) dest_scid = ShortChannelID.from_str(dest_scid) - from_channel = wallet.lnworker.get_channel_by_scid(from_scid) - dest_channel = wallet.lnworker.get_channel_by_scid(dest_scid) + from_channel = wallet.lnworker.get_channel_by_short_id(from_scid) + dest_channel = wallet.lnworker.get_channel_by_short_id(dest_scid) amount_sat = satoshis(amount) success, log = await wallet.lnworker.rebalance_channels( from_channel, diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 2f7c2b1ca..65dffba35 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -882,11 +882,6 @@ class LNWallet(LNWorker): def get_channel_by_id(self, channel_id: bytes) -> Optional[Channel]: return self._channels.get(channel_id, None) - def get_channel_by_scid(self, scid: bytes) -> Optional[Channel]: - for chan in self._channels.values(): - if chan.short_channel_id == scid: - return chan - def diagnostic_name(self): return self.wallet.diagnostic_name()