feature: add update function for safe feature update

Disallow update of any features that are defined by LND (since
just updating the feature, but not the functionality will result in
strange behavior). All known feature bits should be toggled using
protocol config options.
This commit is contained in:
Carla Kirk-Cohen committed 2023-05-04 10:35:44 -04:00
1 parent 1a9d743e18
commit 5a139fd297
3 files changed
+163

No files matched your search

+11
View File
@@ -26,8 +26,19 @@ const (
// SetInvoiceAmp identifies the features that should be advertised on
// AMP invoices generated by the daemon.
SetInvoiceAmp
// setSentinel is used to mark the end of our known sets. This enum
// member must *always* be the last item in the iota list to ensure
// that validation works as expected.
setSentinel
)
// valid returns a boolean indicating whether a set value is one of our
// predefined feature sets.
func (s Set) valid() bool {
return s < setSentinel
}
// String returns a human-readable description of a Set.
func (s Set) String() string {
switch s {