multi: make the next protocol version optional

This commit is contained in:
Andras Banki-Horvath 2022-05-14 17:47:15 +02:00
parent 9b37d744a0
commit 00cf4bf71c
No known key found for this signature in database
GPG key ID: 80E5375C094198D8
7 changed files with 74 additions and 26 deletions

View file

@ -149,6 +149,8 @@ type Config struct {
TotalPaymentTimeout time.Duration `long:"totalpaymenttimeout" description:"The timeout to use for off-chain payments."`
MaxPaymentRetries int `long:"maxpaymentretries" description:"The maximum number of times an off-chain payment may be retried."`
EnableExperimental bool `long:"experimental" description:"Enable experimental features: taproot HTLCs and MuSig2 loop out sweeps."`
Lnd *lndConfig `group:"lnd" namespace:"lnd"`
Server *loopServerConfig `group:"server" namespace:"server"`
@ -185,6 +187,7 @@ func DefaultConfig() Config {
LoopOutMaxParts: defaultLoopOutMaxParts,
TotalPaymentTimeout: defaultTotalPaymentTimeout,
MaxPaymentRetries: defaultMaxPaymentRetries,
EnableExperimental: false,
Lnd: &lndConfig{
Host: "localhost:10009",
MacaroonPath: DefaultLndMacaroonPath,

View file

@ -348,6 +348,12 @@ func (d *Daemon) startWebServers() error {
// this method fails with an error then no goroutine was started yet and no
// cleanup is necessary. If it succeeds, then goroutines have been spawned.
func (d *Daemon) initialize(withMacaroonService bool) error {
if d.cfg.EnableExperimental {
loopdb.EnableExperimentalProtocol()
}
log.Infof("Protocol version: %v", loopdb.CurrentProtocolVersion())
// If no swap server is specified, use the default addresses for mainnet
// and testnet.
if d.cfg.Server.Host == "" {