lnd: signal taproot overlay chans based on config

We also add a sanity check to make sure they can't be signaled without
the aux interfaces.
This commit is contained in:
Olaoluwa Osuntokun 2024-06-25 15:32:21 -07:00
parent c6ba5d11f1
commit 8494887adc
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -547,6 +547,15 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
readBufferPool, cfg.Workers.Read, pool.DefaultWorkerTimeout,
)
// If the taproot overlay flag is set, but we don't have an aux funding
// controller, then we'll exit as this is incompatible.
if cfg.ProtocolOptions.TaprootOverlayChans &&
implCfg.AuxFundingController.IsNone() {
return nil, fmt.Errorf("taproot overlay flag set, but not " +
"aux controllers")
}
//nolint:lll
featureMgr, err := feature.NewManager(feature.Config{
NoTLVOnion: cfg.ProtocolOptions.LegacyOnion(),
@ -560,6 +569,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
NoAnySegwit: cfg.ProtocolOptions.NoAnySegwit(),
CustomFeatures: cfg.ProtocolOptions.CustomFeatures(),
NoTaprootChans: !cfg.ProtocolOptions.TaprootChans,
NoTaprootOverlay: !cfg.ProtocolOptions.TaprootOverlayChans,
NoRouteBlinding: cfg.ProtocolOptions.NoRouteBlinding(),
})
if err != nil {