From 783c887824ff789c3cad6b63767ed9964fc252a5 Mon Sep 17 00:00:00 2001 From: Abdullahi Yunus Date: Mon, 22 Sep 2025 18:21:04 +0100 Subject: [PATCH] lnd: stop using prev persisted addresses In this commit we stop using persisted address in LND's prev run. This means addresses set using `externalip` will be used without merging them with the ones from prev run. We will introduce the condition to use persisted addresses in the next commit. --- server.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/server.go b/server.go index 44be180ea..9c29adf72 100644 --- a/server.go +++ b/server.go @@ -5559,15 +5559,6 @@ func (s *server) setSelfNode(ctx context.Context, nodePub route.Vertex, return fmt.Errorf("unable to normalize addresses: %w", err) } - // To avoid having duplicate addresses, we'll only add addresses from - // the source node that are not already in our address list yet. We - // create this map for quick lookup. - addressMap := make(map[string]struct{}, len(addrs)) - // Populate the map with the existing addresses. - for _, existingAddr := range addrs { - addressMap[existingAddr.String()] = struct{}{} - } - // Parse the color from config. We will update this later if the config // color is not changed from default (#3399FF) and we have a value in // the source node. @@ -5604,15 +5595,6 @@ func (s *server) setSelfNode(ctx context.Context, nodePub route.Vertex, alias = srcNode.Alias } - // Append unique addresses from the source node to the address - // list. - for _, addr := range srcNode.Addresses { - if _, found := addressMap[addr.String()]; !found { - addrs = append(addrs, addr) - addressMap[addr.String()] = struct{}{} - } - } - case errors.Is(err, graphdb.ErrSourceNodeNotSet): // If an alias is not specified in the config, we'll use the // default, which is the first 10 bytes of the serialized