From 8a88ebe6bcb4e3d23a9b1a90a1611000d5a4720b Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 8 Dec 2025 11:00:47 +0100 Subject: [PATCH] lnworker: add type assert to get_channel_by_short_id Prevents accidentally passing None if channel.short_id is not set yet --- electrum/lnworker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index c49aa3dfc..f28c99a16 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -1574,6 +1574,7 @@ class LNWallet(LNWorker): return chan, funding_tx def get_channel_by_short_id(self, short_channel_id: bytes) -> Optional[Channel]: + assert short_channel_id and isinstance(short_channel_id, bytes), repr(short_channel_id) # First check against *real* SCIDs. # This e.g. protects against maliciously chosen SCID aliases, and accidental collisions. for chan in self.channels.values():