Skip to content

Commit

Permalink
feature+lncfg: add new CLI flag to opt into taproot chans
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Jul 27, 2023
1 parent 1606f06 commit 7598dae
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions feature/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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
Expand Down Expand Up @@ -150,6 +154,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)
}

// Ensure that all of our feature sets properly set any
// dependent features.
Expand Down
4 changes: 4 additions & 0 deletions lncfg/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 4 additions & 0 deletions lncfg/protocol_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
3 changes: 3 additions & 0 deletions sample-lnd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,9 @@ litecoin.node=ltcd
; closing.
; protocol.no-any-segwit

; Set to enable support for the experimental taproot channel type.
; protocol.taproot-chans

[db]

; The selected database backend. The current default backend is "bolt". lnd
Expand Down
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
NoOptionScidAlias: !cfg.ProtocolOptions.ScidAlias(),
NoZeroConf: !cfg.ProtocolOptions.ZeroConf(),
NoAnySegwit: cfg.ProtocolOptions.NoAnySegwit(),
NoTaprootChans: !cfg.ProtocolOptions.TaprootChans,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 7598dae

Please sign in to comment.