diff --git a/autopilot/graph.go b/autopilot/graph.go index 413aaf13..f02d0a8e 100644 --- a/autopilot/graph.go +++ b/autopilot/graph.go @@ -157,8 +157,9 @@ func (d *databaseChannelGraph) addRandChannel(node1, node2 *btcec.PublicKey, IP: bytes.Repeat([]byte("a"), 16), }, }, - Features: lnwire.NewFeatureVector(nil, - lnwire.GlobalFeatures), + Features: lnwire.NewFeatureVector( + nil, lnwire.Features, + ), AuthSigBytes: testSig.Serialize(), } graphNode.AddPubKey(pub) @@ -183,7 +184,9 @@ func (d *databaseChannelGraph) addRandChannel(node1, node2 *btcec.PublicKey, IP: bytes.Repeat([]byte("a"), 16), }, }, - Features: lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures), + Features: lnwire.NewFeatureVector( + nil, lnwire.Features, + ), AuthSigBytes: testSig.Serialize(), } dbNode.AddPubKey(nodeKey) @@ -287,7 +290,9 @@ func (d *databaseChannelGraph) addRandNode() (*btcec.PublicKey, error) { IP: bytes.Repeat([]byte("a"), 16), }, }, - Features: lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures), + Features: lnwire.NewFeatureVector( + nil, lnwire.Features, + ), AuthSigBytes: testSig.Serialize(), } dbNode.AddPubKey(nodeKey) diff --git a/channeldb/graph.go b/channeldb/graph.go index 46ba1311..275d6858 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -3506,7 +3506,7 @@ func deserializeLightningNode(r io.Reader) (LightningNode, error) { return LightningNode{}, err } - fv := lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures) + fv := lnwire.NewFeatureVector(nil, lnwire.Features) err = fv.Decode(r) if err != nil { return LightningNode{}, err diff --git a/channeldb/graph_test.go b/channeldb/graph_test.go index de8774a9..0768e829 100644 --- a/channeldb/graph_test.go +++ b/channeldb/graph_test.go @@ -36,7 +36,7 @@ var ( _, _ = testSig.R.SetString("63724406601629180062774974542967536251589935445068131219452686511677818569431", 10) _, _ = testSig.S.SetString("18801056069249825825291287104931333862866033135609736119018462340006816851118", 10) - testFeatures = lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures) + testFeatures = lnwire.NewFeatureVector(nil, lnwire.Features) ) func createLightningNode(db *DB, priv *btcec.PrivateKey) (*LightningNode, error) { diff --git a/channeldb/migration_01_to_11/graph.go b/channeldb/migration_01_to_11/graph.go index 8e8f4a4a..a782b9c4 100644 --- a/channeldb/migration_01_to_11/graph.go +++ b/channeldb/migration_01_to_11/graph.go @@ -744,7 +744,7 @@ func deserializeLightningNode(r io.Reader) (LightningNode, error) { return LightningNode{}, err } - fv := lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures) + fv := lnwire.NewFeatureVector(nil, nil) err = fv.Decode(r) if err != nil { return LightningNode{}, err diff --git a/channeldb/migration_01_to_11/graph_test.go b/channeldb/migration_01_to_11/graph_test.go index a65f0046..dc21fccf 100644 --- a/channeldb/migration_01_to_11/graph_test.go +++ b/channeldb/migration_01_to_11/graph_test.go @@ -25,7 +25,7 @@ var ( _, _ = testSig.R.SetString("63724406601629180062774974542967536251589935445068131219452686511677818569431", 10) _, _ = testSig.S.SetString("18801056069249825825291287104931333862866033135609736119018462340006816851118", 10) - testFeatures = lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures) + testFeatures = lnwire.NewFeatureVector(nil, nil) ) func createLightningNode(db *DB, priv *btcec.PrivateKey) (*LightningNode, error) { diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 5e8e0215..8c9ed6e5 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -1459,9 +1459,7 @@ func (d *AuthenticatedGossiper) addNode(msg *lnwire.NodeAnnouncement) error { } timestamp := time.Unix(int64(msg.Timestamp), 0) - features := lnwire.NewFeatureVector( - msg.Features, lnwire.GlobalFeatures, - ) + features := lnwire.NewFeatureVector(msg.Features, lnwire.Features) node := &channeldb.LightningNode{ HaveNodeAnnouncement: true, LastUpdate: timestamp, diff --git a/lnwire/features.go b/lnwire/features.go index 7ae0cac9..7700e2d5 100644 --- a/lnwire/features.go +++ b/lnwire/features.go @@ -85,30 +85,6 @@ const ( maxAllowedSize = 32764 ) -// LocalFeatures is a mapping of known connection-local feature bits to a -// descriptive name. All known local feature bits must be assigned a name in -// this mapping. Local features are those which are only sent to the peer and -// 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", - DataLossProtectOptional: "data-loss-protect", - InitialRoutingSync: "initial-routing-sync", - GossipQueriesRequired: "gossip-queries", - GossipQueriesOptional: "gossip-queries", -} - -// GlobalFeatures is a mapping of known global feature bits to a descriptive -// name. All known global feature bits must be assigned a name in this mapping. -// Global features are those which are advertised to the entire network. A full -// description of these feature bits is provided in the BOLT-09 specification. -var GlobalFeatures = map[FeatureBit]string{ - TLVOnionPayloadRequired: "tlv-onion", - TLVOnionPayloadOptional: "tlv-onion", - StaticRemoteKeyOptional: "static-remote-key", - 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. diff --git a/routing/notifications_test.go b/routing/notifications_test.go index a18f5c90..2371a4e1 100644 --- a/routing/notifications_test.go +++ b/routing/notifications_test.go @@ -28,7 +28,7 @@ var ( Port: 9000} testAddrs = []net.Addr{testAddr} - testFeatures = lnwire.NewFeatureVector(nil, lnwire.GlobalFeatures) + testFeatures = lnwire.NewFeatureVector(nil, lnwire.Features) testHash = [32]byte{ 0xb7, 0x94, 0x38, 0x5f, 0x2d, 0x1e, 0xf7, 0xab, diff --git a/server.go b/server.go index fbe88c26..87fa17dc 100644 --- a/server.go +++ b/server.go @@ -1971,7 +1971,7 @@ func (s *server) initTorController() error { Addresses: newNodeAnn.Addresses, Alias: newNodeAnn.Alias.String(), Features: lnwire.NewFeatureVector( - newNodeAnn.Features, lnwire.GlobalFeatures, + newNodeAnn.Features, lnwire.Features, ), Color: newNodeAnn.RGBColor, AuthSigBytes: newNodeAnn.Signature.ToSignatureBytes(),