multi: optionally enable and signal anchor support

Defaults to disabled.
This commit is contained in:
Johan T. Halseth committed 2020-03-09 12:59:34 +01:00
1 parent 44756b5811
commit 21126ab0f3
7 files changed
+60 -10

No files matched your search

+4
View File
@@ -43,4 +43,8 @@ var defaultSetDesc = setDesc{
SetNodeAnn: {}, // N
SetInvoice: {}, // 9
},
lnwire.AnchorsOptional: {
SetInit: {}, // I
SetNodeAnn: {}, // N
},
}
+3
View File
@@ -55,6 +55,9 @@ var deps = depDesc{
lnwire.MPPOptional: {
lnwire.PaymentAddrOptional: {},
},
lnwire.AnchorsOptional: {
lnwire.StaticRemoteKeyOptional: {},
},
}
// ValidateDeps asserts that a feature vector sets all features and their
+7
View File
@@ -17,6 +17,9 @@ type Config struct {
// NoStaticRemoteKey unsets any optional or required StaticRemoteKey
// bits from all feature sets.
NoStaticRemoteKey bool
// NoAnchors unsets any bits signaling support for anchor outputs.
NoAnchors bool
}
// Manager is responsible for generating feature vectors for different requested
@@ -76,6 +79,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
raw.Unset(lnwire.StaticRemoteKeyOptional)
raw.Unset(lnwire.StaticRemoteKeyRequired)
}
if cfg.NoAnchors {
raw.Unset(lnwire.AnchorsOptional)
raw.Unset(lnwire.AnchorsRequired)
}
// Ensure that all of our feature sets properly set any
// dependent features.