From 90e36ca04b39856ab949df864d817f7e27bc34e3 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 8 Nov 2019 05:28:47 -0800 Subject: [PATCH] lnwire/features: add unified Features namespace --- lnwire/features.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lnwire/features.go b/lnwire/features.go index 9a34a637..2b7d9084 100644 --- a/lnwire/features.go +++ b/lnwire/features.go @@ -102,6 +102,21 @@ var GlobalFeatures = map[FeatureBit]string{ StaticRemoteKeyRequired: "static-remote-key", } +// Features is a mapping of known feature bits to a descriptive name. All known +// feature bits must be assigned a name in this mapping, and feature bit pairs +// must be assigned together for correct behavior. +var Features = map[FeatureBit]string{ + DataLossProtectRequired: "data-loss-protect", + DataLossProtectOptional: "data-loss-protect", + InitialRoutingSync: "initial-routing-sync", + GossipQueriesRequired: "gossip-queries", + GossipQueriesOptional: "gossip-queries", + TLVOnionPayloadRequired: "tlv-onion", + TLVOnionPayloadOptional: "tlv-onion", + StaticRemoteKeyOptional: "static-remote-key", + StaticRemoteKeyRequired: "static-remote-key", +} + // RawFeatureVector represents a set of feature bits as defined in BOLT-09. A // RawFeatureVector itself just stores a set of bit flags but can be used to // construct a FeatureVector which binds meaning to each bit. Feature vectors