mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 05:42:37 +02:00
feature: add new feature pkg to manage feature sets
This commit introduces a feature.Manager, which derives feature vectors for various contexts within the daemon. The sets can be described via a staticly compiled format, which makes any runtime adjustments to the feature sets when the manager is initialized.
This commit is contained in:
32
feature/default_sets.go
Normal file
32
feature/default_sets.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package feature
|
||||
|
||||
import "github.com/lightningnetwork/lnd/lnwire"
|
||||
|
||||
// setDesc describes which feature bits should be advertised in which feature
|
||||
// sets.
|
||||
type setDesc map[lnwire.FeatureBit]map[Set]struct{}
|
||||
|
||||
// defaultSetDesc are the default set descriptors for generating feature
|
||||
// vectors. Each set is annotated with the corresponding identifier from BOLT 9
|
||||
// indicating where it should be advertised.
|
||||
var defaultSetDesc = setDesc{
|
||||
lnwire.DataLossProtectRequired: {
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
},
|
||||
lnwire.GossipQueriesOptional: {
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
},
|
||||
lnwire.TLVOnionPayloadOptional: {
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
SetInvoice: {}, // 9
|
||||
SetLegacyGlobal: {},
|
||||
},
|
||||
lnwire.StaticRemoteKeyOptional: {
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
SetLegacyGlobal: {},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user