lncfg: add protocol config option for script enforced lease support

This commit is contained in:
Wilmer Paulino 2021-07-13 15:11:14 -07:00 committed by Olaoluwa Osuntokun
parent e590abc7be
commit 35fd985118
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306
3 changed files with 29 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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]