lnutil.LnFeatures: impl and use "supports" method for feature-bit-tests
Note that for a required feature, BOLT-09 allows setting either: - only the REQ bit - both the REQ bit and the OPT bit Hence, when checking if a feature is supported by e.g. an invoice, both bits should be checked. Note that in lnpeer.py, in self.features specifically, REQ implies OPT, as it is set by ln_compare_features.
This commit is contained in:
@@ -96,8 +96,8 @@ class RouteEdge(PathEdge):
|
||||
return True
|
||||
|
||||
def has_feature_varonion(self) -> bool:
|
||||
features = self.node_features
|
||||
return bool(features & LnFeatures.VAR_ONION_REQ or features & LnFeatures.VAR_ONION_OPT)
|
||||
features = LnFeatures(self.node_features)
|
||||
return features.supports(LnFeatures.VAR_ONION_OPT)
|
||||
|
||||
def is_trampoline(self):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user