mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: optionally enable and signal anchor support
Defaults to disabled.
This commit is contained in:
@@ -43,4 +43,8 @@ var defaultSetDesc = setDesc{
|
||||
SetNodeAnn: {}, // N
|
||||
SetInvoice: {}, // 9
|
||||
},
|
||||
lnwire.AnchorsOptional: {
|
||||
SetInit: {}, // I
|
||||
SetNodeAnn: {}, // N
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user