From 5c434b17ff813da74e097ed5cba57958dcf3063b Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 31 Jan 2019 20:58:10 -0800 Subject: [PATCH] lnwire: ensure even/odd features have the same base name In this commit, we fix a bug in the way we defined our even/odd features for a particular feature. The check for if a feature bit is part of a pair assumes that the pair bit has the exact same name as the bit being queried. The way we defined our feature map didn't take note of this assumption, as a result, any attempts to require a new bit moving from optional to required would fail since the bit would be found, but the names differed. --- lnwire/features.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lnwire/features.go b/lnwire/features.go index 7ad12d84..e4cbe5de 100644 --- a/lnwire/features.go +++ b/lnwire/features.go @@ -67,11 +67,11 @@ const ( // not advertised to the entire network. A full description of these feature // bits is provided in the BOLT-09 specification. var LocalFeatures = map[FeatureBit]string{ - DataLossProtectRequired: "data-loss-protect-required", - DataLossProtectOptional: "data-loss-protect-optional", + DataLossProtectRequired: "data-loss-protect", + DataLossProtectOptional: "data-loss-protect", InitialRoutingSync: "initial-routing-sync", - GossipQueriesRequired: "gossip-queries-required", - GossipQueriesOptional: "gossip-queries-optional", + GossipQueriesRequired: "gossip-queries", + GossipQueriesOptional: "gossip-queries", } // GlobalFeatures is a mapping of known global feature bits to a descriptive