From c86761f1b3fc1528b33fbf879fc0151c3d89491f Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Thu, 14 Jan 2021 09:09:42 +0100 Subject: [PATCH] lncfg: make anchor commitments opt-in This commit reverts the anchors-by-default change, and instead make anchor commitments and opt-in option. The plan is to enable anchors by default further down the line. --- lncfg/protocol.go | 9 +++------ lncfg/protocol_rpctest.go | 38 -------------------------------------- 2 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 lncfg/protocol_rpctest.go diff --git a/lncfg/protocol.go b/lncfg/protocol.go index afc12968..20bad430 100644 --- a/lncfg/protocol.go +++ b/lncfg/protocol.go @@ -1,5 +1,3 @@ -// +build !rpctest - package lncfg // ProtocolOptions is a struct that we use to be able to test backwards @@ -20,9 +18,8 @@ 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"` - // 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"` + // Anchors enables anchor commitments. + Anchors bool `long:"anchors" description:"enable support for anchor commitments"` } // Wumbo returns true if lnd should permit the creation and acceptance of wumbo @@ -34,5 +31,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.NoAnchors + return !l.Anchors } diff --git a/lncfg/protocol_rpctest.go b/lncfg/protocol_rpctest.go deleted file mode 100644 index 037aec77..00000000 --- a/lncfg/protocol_rpctest.go +++ /dev/null @@ -1,38 +0,0 @@ -// +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 -}