1
0

lnworker: add type assert to get_channel_by_short_id

Prevents accidentally passing None if channel.short_id is not set yet
This commit is contained in:
f321x
2025-12-08 11:00:47 +01:00
parent 6d1e8e8619
commit 8a88ebe6bc

View File

@@ -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():