feature/manager: ensure all feature sets properly set deps
This commit is contained in:
parent
868a5425c1
commit
3208e287c3
@ -63,14 +63,27 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
|
||||
}
|
||||
|
||||
// Now, remove any features as directed by the config.
|
||||
for _, fv := range fsets {
|
||||
for set, raw := range fsets {
|
||||
if cfg.NoTLVOnion {
|
||||
fv.Unset(lnwire.TLVOnionPayloadOptional)
|
||||
fv.Unset(lnwire.TLVOnionPayloadRequired)
|
||||
raw.Unset(lnwire.TLVOnionPayloadOptional)
|
||||
raw.Unset(lnwire.TLVOnionPayloadRequired)
|
||||
raw.Unset(lnwire.PaymentAddrOptional)
|
||||
raw.Unset(lnwire.PaymentAddrRequired)
|
||||
raw.Unset(lnwire.MPPOptional)
|
||||
raw.Unset(lnwire.MPPRequired)
|
||||
}
|
||||
if cfg.NoStaticRemoteKey {
|
||||
fv.Unset(lnwire.StaticRemoteKeyOptional)
|
||||
fv.Unset(lnwire.StaticRemoteKeyRequired)
|
||||
raw.Unset(lnwire.StaticRemoteKeyOptional)
|
||||
raw.Unset(lnwire.StaticRemoteKeyRequired)
|
||||
}
|
||||
|
||||
// Ensure that all of our feature sets properly set any
|
||||
// dependent features.
|
||||
fv := lnwire.NewFeatureVector(raw, lnwire.Features)
|
||||
err := ValidateDeps(fv)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid feature set %v: %v",
|
||||
set, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user