From 6e5eead61721dd647074d2f069beee3f8e97dc8b Mon Sep 17 00:00:00 2001 From: Carla Kirk-Cohen Date: Fri, 22 Mar 2024 13:39:17 -0400 Subject: [PATCH] lncfg: disable allowing blinded routes in daemon but not itests This commit turns off route blinding for the daemon while we're waiting on full handling for blinded errors. The feature remains on for itests so that tests covering blinding can run as usual. --- config.go | 5 +++-- lncfg/protocol.go | 8 ++++++++ lncfg/protocol_integration.go | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index f9aec0284..384995087 100644 --- a/config.go +++ b/config.go @@ -626,8 +626,9 @@ func DefaultConfig() Config { RejectCacheSize: channeldb.DefaultRejectCacheSize, ChannelCacheSize: channeldb.DefaultChannelCacheSize, }, - Prometheus: lncfg.DefaultPrometheus(), - Watchtower: lncfg.DefaultWatchtowerCfg(defaultTowerDir), + Prometheus: lncfg.DefaultPrometheus(), + Watchtower: lncfg.DefaultWatchtowerCfg(defaultTowerDir), + ProtocolOptions: lncfg.DefaultProtocol(), HealthChecks: &lncfg.HealthCheckConfig{ ChainCheck: &lncfg.CheckConfig{ Interval: defaultChainInterval, diff --git a/lncfg/protocol.go b/lncfg/protocol.go index e98b4dcf8..59027a09b 100644 --- a/lncfg/protocol.go +++ b/lncfg/protocol.go @@ -59,6 +59,14 @@ type ProtocolOptions struct { NoRouteBlindingOption bool `long:"no-route-blinding" description:"do not forward payments that are a part of a blinded route"` } +// DefaultProtocol returns a protocol config with route blinding turned off, +// temporarily in place until full handling of blinded route errors is merged. +func DefaultProtocol() *ProtocolOptions { + return &ProtocolOptions{ + NoRouteBlindingOption: true, + } +} + // Wumbo returns true if lnd should permit the creation and acceptance of wumbo // channels. func (l *ProtocolOptions) Wumbo() bool { diff --git a/lncfg/protocol_integration.go b/lncfg/protocol_integration.go index 841f8e9eb..f44aa1246 100644 --- a/lncfg/protocol_integration.go +++ b/lncfg/protocol_integration.go @@ -62,6 +62,13 @@ type ProtocolOptions struct { NoRouteBlindingOption bool `long:"no-route-blinding" description:"do not forward payments that are a part of a blinded route"` } +// DefaultProtocol returns a protocol config with route blinding turned on, +// so that itests can run against route blinding features even while we've +// got it turned off for the daemon (pending completion of error handling). +func DefaultProtocol() *ProtocolOptions { + return &ProtocolOptions{} +} + // Wumbo returns true if lnd should permit the creation and acceptance of wumbo // channels. func (l *ProtocolOptions) Wumbo() bool {