Skip to content

Commit

Permalink
lncfg: make anchor channels by default
Browse files Browse the repository at this point in the history
This commit again enables anchor channels by default.

During itests we still keep anchors opt-in, as many of the tests rely on
the behaviour of non-anchor channels.
  • Loading branch information
halseth committed May 11, 2021
1 parent 8e1087d commit 820e77d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lncfg/protocol.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build !rpctest

package lncfg

// ProtocolOptions is a struct that we use to be able to test backwards
Expand All @@ -18,8 +20,9 @@ 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"`

// Anchors enables anchor commitments.
Anchors bool `long:"anchors" description:"enable support for anchor commitments"`
// 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"`
}

// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
Expand All @@ -31,5 +34,5 @@ func (l *ProtocolOptions) Wumbo() bool {
// NoAnchorCommitments returns true if we have disabled support for the anchor
// commitment type.
func (l *ProtocolOptions) NoAnchorCommitments() bool {
return !l.Anchors
return l.NoAnchors
}
38 changes: 38 additions & 0 deletions lncfg/protocol_rpctest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// +build rpctest

package lncfg

// ProtocolOptions is a struct that we use to be able to test backwards
// compatibility of protocol additions, while defaulting to the latest within
// lnd, or to enable experimental protocol changes.
type ProtocolOptions struct {
// LegacyProtocol is a sub-config that houses all the legacy protocol
// options. These are mostly used for integration tests as most modern
// nodes shuld always run with them on by default.
LegacyProtocol `group:"legacy" namespace:"legacy"`

// ExperimentalProtocol is a sub-config that houses any experimental
// protocol features that also require a build-tag to activate.
ExperimentalProtocol

// WumboChans should be set if we want to enable support for wumbo
// (channels larger than 0.16 BTC) channels, which is the opposite of
// mini.
WumboChans bool `long:"wumbo-channels" description:"if set, then lnd will create and accept requests for channels larger chan 0.16 BTC"`

// Anchors enables anchor commitments.
// TODO(halseth): transition itests to anchors instead!
Anchors bool `long:"anchors" description:"enable support for anchor commitments"`
}

// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
// channels.
func (l *ProtocolOptions) Wumbo() bool {
return l.WumboChans
}

// NoAnchorCommitments returns true if we have disabled support for the anchor
// commitment type.
func (l *ProtocolOptions) NoAnchorCommitments() bool {
return !l.Anchors
}

0 comments on commit 820e77d

Please sign in to comment.