config+protocol: enable anchor commitments (zero-fee HTLC ) by default

This commit is contained in:
Johan T. Halseth 2020-12-14 20:51:35 +01:00
parent 1923d40843
commit c92c06400b
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
4 changed files with 11 additions and 16 deletions

View File

@ -17,6 +17,10 @@ type ProtocolOptions struct {
// (channels larger than 0.16 BTC) channels, which is the opposite of // (channels larger than 0.16 BTC) channels, which is the opposite of
// mini. // mini.
WumboChans bool `long:"wumbo-channels" description:"if set, then lnd will create and accept requests for channels larger chan 0.16 BTC"` WumboChans bool `long:"wumbo-channels" description:"if set, then lnd will create and accept requests for channels larger chan 0.16 BTC"`
// 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 // Wumbo returns true if lnd should permit the creation and acceptance of wumbo
@ -24,3 +28,9 @@ type ProtocolOptions struct {
func (l *ProtocolOptions) Wumbo() bool { func (l *ProtocolOptions) Wumbo() bool {
return l.WumboChans return l.WumboChans
} }
// NoAnchorCommitments returns true if we have disabled support for the anchor
// commitment type.
func (l *ProtocolOptions) NoAnchorCommitments() bool {
return l.NoAnchors
}

View File

@ -6,9 +6,3 @@ package lncfg
// features that also require a build-tag to activate. // features that also require a build-tag to activate.
type ExperimentalProtocol struct { type ExperimentalProtocol struct {
} }
// AnchorCommitments returns true if support for the anchor commitment type
// should be signaled.
func (l *ExperimentalProtocol) AnchorCommitments() bool {
return false
}

View File

@ -5,13 +5,4 @@ package lncfg
// ExperimentalProtocol is a sub-config that houses any experimental protocol // ExperimentalProtocol is a sub-config that houses any experimental protocol
// features that also require a build-tag to activate. // features that also require a build-tag to activate.
type ExperimentalProtocol struct { type ExperimentalProtocol struct {
// Anchors should be set if we want to support opening or accepting
// channels having the anchor commitment type.
Anchors bool `long:"anchors" description:"EXPERIMENTAL: enable experimental support for anchor commitments, won't work with watchtowers"`
}
// AnchorCommitments returns true if support for the anchor commitment type
// should be signaled.
func (l *ExperimentalProtocol) AnchorCommitments() bool {
return l.Anchors
} }

View File

@ -404,7 +404,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
featureMgr, err := feature.NewManager(feature.Config{ featureMgr, err := feature.NewManager(feature.Config{
NoTLVOnion: cfg.ProtocolOptions.LegacyOnion(), NoTLVOnion: cfg.ProtocolOptions.LegacyOnion(),
NoStaticRemoteKey: cfg.ProtocolOptions.NoStaticRemoteKey(), NoStaticRemoteKey: cfg.ProtocolOptions.NoStaticRemoteKey(),
NoAnchors: !cfg.ProtocolOptions.AnchorCommitments(), NoAnchors: cfg.ProtocolOptions.NoAnchorCommitments(),
NoWumbo: !cfg.ProtocolOptions.Wumbo(), NoWumbo: !cfg.ProtocolOptions.Wumbo(),
}) })
if err != nil { if err != nil {