feature: add awareness of new taproot chans overlay feature bit

This bit will be false by default in current production deployments.
This commit is contained in:
Olaoluwa Osuntokun committed 2024-10-02 18:10:05 -07:00
1 parent 7f9268c38f
commit f21c1165a0
3 files changed
+16

No files matched your search

+4
View File
@@ -92,4 +92,8 @@ var defaultSetDesc = setDesc{
SetInit: {}, // I
SetNodeAnn: {}, // N
},
lnwire.SimpleTaprootOverlayChansOptional: {
SetInit: {}, // I
SetNodeAnn: {}, // N
},
}
+5
View File
@@ -79,6 +79,11 @@ var deps = depDesc{
lnwire.AnchorsZeroFeeHtlcTxOptional: {},
lnwire.ExplicitChannelTypeOptional: {},
},
lnwire.SimpleTaprootOverlayChansOptional: {
lnwire.SimpleTaprootChannelsOptionalStaging: {},
lnwire.TLVOnionPayloadOptional: {},
lnwire.ScidAliasOptional: {},
},
lnwire.RouteBlindingOptional: {
lnwire.TLVOnionPayloadOptional: {},
},
+7
View File
@@ -63,6 +63,9 @@ type Config struct {
// NoRouteBlinding unsets route blinding feature bits.
NoRouteBlinding bool
// NoTaprootOverlay unsets the taproot overlay channel feature bits.
NoTaprootOverlay bool
// CustomFeatures is a set of custom features to advertise in each
// set.
CustomFeatures map[Set][]lnwire.FeatureBit
@@ -192,6 +195,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
raw.Unset(lnwire.Bolt11BlindedPathsOptional)
raw.Unset(lnwire.Bolt11BlindedPathsRequired)
}
if cfg.NoTaprootOverlay {
raw.Unset(lnwire.SimpleTaprootOverlayChansOptional)
raw.Unset(lnwire.SimpleTaprootOverlayChansRequired)
}
for _, custom := range cfg.CustomFeatures[set] {
if custom > set.Maximum() {
return nil, fmt.Errorf("feature bit: %v "+