Browse Source

lnutil.LnFeatures.get_names: don't return `None`s for unknown features

follow-up 85d354bf24

`'\n'.join(lnaddr.get_features().get_names())` would raise otherwise
patch-4
SomberNight 3 years ago
parent
commit
9b48a97f65
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/lnutil.py

5
electrum/lnutil.py

@ -1192,10 +1192,11 @@ class LnFeatures(IntFlag):
return (flag in our_flags
or get_ln_flag_pair_of_bit(flag) in our_flags)
def get_names(self):
def get_names(self) -> Sequence[str]:
r = []
for flag in list_enabled_bits(self):
r.append(LnFeatures(1 << flag).name)
feature_name = LnFeatures(1 << flag).name
r.append(feature_name or f"bit_{flag}")
return r

Loading…
Cancel
Save