From 5345069b16fb3ff3ba8e88a78a807e959f6eeef6 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 1 Jul 2020 21:04:25 -0700 Subject: [PATCH] server+lncfg: add new config flag to enable wumbo channels In this commit, we add a new config flag to enable wumbo channels, with the default being that nodes reject all wumbo channel attempts. --- lncfg/protocol.go | 11 +++++++++++ server.go | 1 + 2 files changed, 12 insertions(+) diff --git a/lncfg/protocol.go b/lncfg/protocol.go index ea4b1bfc..5e1be5e6 100644 --- a/lncfg/protocol.go +++ b/lncfg/protocol.go @@ -12,4 +12,15 @@ type ProtocolOptions struct { // 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"` +} + +// Wumbo returns true if lnd should permit the creation and acceptance of wumbo +// channels. +func (l *ProtocolOptions) Wumbo() bool { + return l.WumboChans } diff --git a/server.go b/server.go index 69aea9e0..d00340b0 100644 --- a/server.go +++ b/server.go @@ -410,6 +410,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr, chanDB *channeldb.DB, NoTLVOnion: cfg.ProtocolOptions.LegacyOnion(), NoStaticRemoteKey: cfg.ProtocolOptions.NoStaticRemoteKey(), NoAnchors: !cfg.ProtocolOptions.AnchorCommitments(), + NoWumbo: !cfg.ProtocolOptions.Wumbo(), }) if err != nil { return nil, err