From 22e391f0559e5703f8bcfc7f29c3d13874906c74 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Thu, 30 Jan 2025 13:49:04 +0200 Subject: [PATCH] discovery: add AssumeChannelValid config option in preparation for later on when we need to know when to skip funding transaction validation. --- discovery/gossiper.go | 5 +++++ server.go | 1 + 2 files changed, 6 insertions(+) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 9cff71c6e..d9288f766 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -364,6 +364,11 @@ type Config struct { // updates for a channel and returns true if the channel should be // considered a zombie based on these timestamps. IsStillZombieChannel func(time.Time, time.Time) bool + + // AssumeChannelValid toggles whether the gossiper will check for + // spent-ness of channel outpoints. For neutrino, this saves long + // rescans from blocking initial usage of the daemon. + AssumeChannelValid bool } // processedNetworkMsg is a wrapper around networkMsg and a boolean. It is diff --git a/server.go b/server.go index d71ebc032..f85d60f52 100644 --- a/server.go +++ b/server.go @@ -1142,6 +1142,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr, FindChannel: s.findChannel, IsStillZombieChannel: s.graphBuilder.IsZombieChannel, ScidCloser: scidCloserMan, + AssumeChannelValid: cfg.Routing.AssumeChannelValid, }, nodeKeyDesc) selfVertex := route.Vertex(nodeKeyDesc.PubKey.SerializeCompressed())