Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDeps ¶
func ValidateDeps(fv *lnwire.FeatureVector) error
ValidateDeps asserts that a feature vector sets all features and their transitive dependencies properly. It assumes that the dependencies between optional and required features are identical, e.g. if a feature is required but its dependency is optional, that is sufficient.
func ValidateRequired ¶
func ValidateRequired(fv *lnwire.FeatureVector) error
ValidateRequired returns an error if the feature vector contains a non-zero number of unknown, required feature bits.
Types ¶
type Config ¶
type Config struct { // NoTLVOnion unsets any optional or required TLVOnionPaylod bits from // all feature sets. NoTLVOnion bool // 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 // NoWumbo unsets any bits signalling support for wumbo channels. NoWumbo bool // NoScriptEnforcementLease unsets any bits signaling support for script // enforced leases. NoScriptEnforcementLease bool }
Config houses any runtime modifications to the default set descriptors. For our purposes, this typically means disabling certain features to test legacy protocol interoperability or functionality.
type ErrMissingFeatureDep ¶
type ErrMissingFeatureDep struct {
// contains filtered or unexported fields
}
ErrMissingFeatureDep is an error signaling that a transitive dependency in a feature vector is not set properly.
func NewErrMissingFeatureDep ¶
func NewErrMissingFeatureDep(dep lnwire.FeatureBit) ErrMissingFeatureDep
NewErrMissingFeatureDep creates a new ErrMissingFeatureDep error.
func (ErrMissingFeatureDep) Error ¶
func (e ErrMissingFeatureDep) Error() string
Error returns a human-readable description of the missing dep error.
type ErrUnknownRequired ¶
type ErrUnknownRequired struct {
// contains filtered or unexported fields
}
ErrUnknownRequired signals that a feature vector requires certain features that our node is unaware of or does not implement.
func NewErrUnknownRequired ¶
func NewErrUnknownRequired(unknown []lnwire.FeatureBit) ErrUnknownRequired
NewErrUnknownRequired initializes an ErrUnknownRequired with the unknown feature bits.
func (ErrUnknownRequired) Error ¶
func (e ErrUnknownRequired) Error() string
Error returns a human-readable description of the error.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is responsible for generating feature vectors for different requested feature sets.
func NewManager ¶
NewManager creates a new feature Manager, applying any custom modifications to its feature sets before returning.
func (*Manager) Get ¶
func (m *Manager) Get(set Set) *lnwire.FeatureVector
Get returns a feature vector for the passed set. If no set is known, an empty feature vector is returned.
type Set ¶
type Set uint8
Set is an enum identifying various feature sets, which separates the single feature namespace into distinct categories depending what context a feature vector is being used.
const ( // SetInit identifies features that should be sent in an Init message to // a remote peer. SetInit Set = iota // SetLegacyGlobal identifies features that should be set in the legacy // GlobalFeatures field of an Init message, which maintains backwards // compatibility with nodes that haven't implemented flat features. SetLegacyGlobal // SetNodeAnn identifies features that should be advertised on node // announcements. SetNodeAnn // SetInvoice identifies features that should be advertised on invoices // generated by the daemon. SetInvoice // SetInvoiceAmp identifies the features that should be advertised on // AMP invoices generated by the daemon. SetInvoiceAmp )