diff --git a/lncfg/protocol.go b/lncfg/protocol.go index 1c2491172..86580d018 100644 --- a/lncfg/protocol.go +++ b/lncfg/protocol.go @@ -24,6 +24,11 @@ type ProtocolOptions struct { // 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"` + + // NoScriptEnforcedLease should be set if we don't want to support + // opening or accepting channels having the script enforced commitment + // type for leased channel. + NoScriptEnforcedLease bool `long:"no-script-enforced-lease" description:"disable support for script enforced lease commitments"` } // Wumbo returns true if lnd should permit the creation and acceptance of wumbo @@ -37,3 +42,9 @@ func (l *ProtocolOptions) Wumbo() bool { func (l *ProtocolOptions) NoAnchorCommitments() bool { return l.NoAnchors } + +// NoScriptEnforcementLease returns true if we have disabled support for the +// script enforcement commitment type for leased channels. +func (l *ProtocolOptions) NoScriptEnforcementLease() bool { + return l.NoScriptEnforcedLease +} diff --git a/lncfg/protocol_rpctest.go b/lncfg/protocol_rpctest.go index 910b9ed31..5630cf52b 100644 --- a/lncfg/protocol_rpctest.go +++ b/lncfg/protocol_rpctest.go @@ -24,6 +24,12 @@ type ProtocolOptions struct { // Anchors enables anchor commitments. // TODO(halseth): transition itests to anchors instead! Anchors bool `long:"anchors" description:"enable support for anchor commitments"` + + // ScriptEnforcedLease enables script enforced commitments for channel + // leases. + // + // TODO: Move to experimental? + ScriptEnforcedLease bool `long:"script-enforced-lease" description:"enable support for script enforced lease commitments"` } // Wumbo returns true if lnd should permit the creation and acceptance of wumbo @@ -37,3 +43,9 @@ func (l *ProtocolOptions) Wumbo() bool { func (l *ProtocolOptions) NoAnchorCommitments() bool { return !l.Anchors } + +// NoScriptEnforcementLease returns true if we have disabled support for the +// script enforcement commitment type for leased channels. +func (l *ProtocolOptions) NoScriptEnforcementLease() bool { + return !l.ScriptEnforcedLease +} diff --git a/sample-lnd.conf b/sample-lnd.conf index 88f7a13f4..2bcbe10c0 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -1101,6 +1101,12 @@ litecoin.node=ltcd ; (Deprecates the previous "protocol.anchors" setting.) ; protocol.no-anchors=true +; Set to disable support for script enforced lease channel commitments. If not +; set, lnd will accept these channels by default if the remote channel party +; proposes them. Note that lnd will require 1 UTXO to be reserved for this +; channel type if it is enabled. +; protocol.no-script-enforced-lease=true + [db]