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.
This commit is contained in:
Abdullahi Yunus
2025-09-22 18:21:04 +01:00
parent 2d8c9d48a4
commit 783c887824

View File

@@ -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