feature: if a bit is unset, then all other features that dep it should be

This fixes an issue where if one tries to unset a feature like anchors,
and other feature depend on it, then `lnd` fails to start as it realizes
that its dependnacy set is inconsistent.

Fixes https://github.com/lightningnetwork/lnd/issues/6002
This commit is contained in:
Olaoluwa Osuntokun authored and Oliver Gugger committed 2021-11-24 14:35:34 +01:00
1 parent 80720cb63f
commit 31ae48c59c
2 files changed
+25

No files matched your search

+10
View File
@@ -52,6 +52,12 @@ var managerTests = []managerTest{
NoStaticRemoteKey: true,
},
},
{
name: "anchors should disable anything dependent on it",
cfg: Config{
NoAnchors: true,
},
},
}
// TestManager asserts basic initialazation and operation of a feature manager,
@@ -104,6 +110,10 @@ func testManager(t *testing.T, test managerTest) {
if test.cfg.NoStaticRemoteKey {
assertUnset(lnwire.StaticRemoteKeyOptional)
}
if test.cfg.NoAnchors {
assertUnset(lnwire.ScriptEnforcedLeaseRequired)
assertUnset(lnwire.ScriptEnforcedLeaseOptional)
}
assertUnset(unknownFeature)
}