feature+lncfg: add new CLI flag to opt into taproot chans

This commit is contained in:
Olaoluwa Osuntokun
2023-07-25 17:44:59 -07:00
parent 6dc43ad253
commit 7323e9373b
5 changed files with 20 additions and 0 deletions

View File

@@ -35,6 +35,10 @@ type Config struct {
// NoWumbo unsets any bits signalling support for wumbo channels.
NoWumbo bool
// NoTaprootChans unsets any bits signaling support for taproot
// channels.
NoTaprootChans bool
// NoScriptEnforcementLease unsets any bits signaling support for script
// enforced leases.
NoScriptEnforcementLease bool
@@ -171,6 +175,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
raw.Unset(lnwire.ShutdownAnySegwitOptional)
raw.Unset(lnwire.ShutdownAnySegwitRequired)
}
if cfg.NoTaprootChans {
raw.Unset(lnwire.SimpleTaprootChannelsOptional)
raw.Unset(lnwire.SimpleTaprootChannelsRequired)
}
for _, custom := range cfg.CustomFeatures[set] {
if custom > set.Maximum() {

View File

@@ -22,6 +22,10 @@ type ProtocolOptions struct {
// mini.
WumboChans bool `long:"wumbo-channels" description:"if set, then lnd will create and accept requests for channels larger chan 0.16 BTC"`
// TaprootChans should be set if we want to enable support for the
// experimental simple taproot chans commitment type.
TaprootChans bool `long:"taproot-chans" description:"if set, then lnd will create and accept requests for channels using the simple taproot commitment type"`
// NoAnchors should be set if we don't want to support opening or accepting
// channels having the anchor commitment type.
NoAnchors bool `long:"no-anchors" description:"disable support for anchor commitments"`

View File

@@ -24,6 +24,10 @@ type ProtocolOptions struct {
// mini.
WumboChans bool `long:"wumbo-channels" description:"if set, then lnd will create and accept requests for channels larger chan 0.16 BTC"`
// TaprootChans should be set if we want to enable support for the
// experimental simple taproot chans commitment type.
TaprootChans bool `long:"taproot-chans" description:"if set, then lnd will create and accept requests for channels using the simple taproot commitment type"`
// Anchors enables anchor commitments.
// TODO(halseth): transition itests to anchors instead!
Anchors bool `long:"anchors" description:"enable support for anchor commitments"`

View File

@@ -1461,6 +1461,9 @@
; protocol.no-any-segwit=false
; Set to enable support for the experimental taproot channel type.
; protocol.simple-taproot-chans
[db]
; The selected database backend. The current default backend is "bolt". lnd

View File

@@ -542,6 +542,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
NoZeroConf: !cfg.ProtocolOptions.ZeroConf(),
NoAnySegwit: cfg.ProtocolOptions.NoAnySegwit(),
CustomFeatures: cfg.ProtocolOptions.ExperimentalProtocol.CustomFeatures(),
NoTaprootChans: !cfg.ProtocolOptions.TaprootChans,
})
if err != nil {
return nil, err