lnwire+feature: add feature bit for script enforced lease support

This commit is contained in:
Wilmer Paulino authored and Olaoluwa Osuntokun committed 2021-10-19 18:30:14 -07:00
1 parent 35fd985118
commit 6052a446dc
5 files changed
+41 -4

No files matched your search

+4
View File
@@ -64,4 +64,8 @@ var defaultSetDesc = setDesc{
SetInit: {}, // I
SetNodeAnn: {}, // N
},
lnwire.ScriptEnforcedLeaseOptional: {
SetInit: {}, // I
SetNodeAnn: {}, // N
},
}
+4
View File
@@ -65,6 +65,10 @@ var deps = depDesc{
lnwire.PaymentAddrOptional: {},
},
lnwire.ExplicitChannelTypeOptional: {},
lnwire.ScriptEnforcedLeaseOptional: {
lnwire.ExplicitChannelTypeOptional: {},
lnwire.AnchorsZeroFeeHtlcTxOptional: {},
},
}
// ValidateDeps asserts that a feature vector sets all features and their
+8
View File
@@ -23,6 +23,10 @@ type Config struct {
// NoWumbo unsets any bits signalling support for wumbo channels.
NoWumbo bool
// NoScriptEnforcementLease unsets any bits signaling support for script
// enforced leases.
NoScriptEnforcementLease bool
}
// Manager is responsible for generating feature vectors for different requested
@@ -92,6 +96,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
raw.Unset(lnwire.WumboChannelsOptional)
raw.Unset(lnwire.WumboChannelsRequired)
}
if cfg.NoScriptEnforcementLease {
raw.Unset(lnwire.ScriptEnforcedLeaseOptional)
raw.Unset(lnwire.ScriptEnforcedLeaseRequired)
}
// Ensure that all of our feature sets properly set any
// dependent features.