multi/refactor: separate methods for get and set node announcement

In preparation for a more complex function signature for set node
announcement, separate get and set so that readonly callers don't need
to handle the extra arguments.
This commit is contained in:
Carla Kirk-Cohen committed 2023-05-04 10:35:42 -04:00
1 parent c6263c2fe6
commit 3f9f0ea5d1
10 files changed
+94 -91

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ import (
type Config struct {
// GetNodeAnnouncement is used to send our retrieve the current
// node announcement information.
GetNodeAnnouncement func() (lnwire.NodeAnnouncement, error)
GetNodeAnnouncement func() lnwire.NodeAnnouncement
// ParseAddr parses an address from its string format to a net.Addr.
ParseAddr func(addr string) (net.Addr, error)
+1 -5
View File
@@ -313,11 +313,7 @@ func (s *Server) UpdateNodeAnnouncement(_ context.Context,
resp := &NodeAnnouncementUpdateResponse{}
nodeModifiers := make([]netann.NodeAnnModifier, 0)
currentNodeAnn, err := s.cfg.GetNodeAnnouncement()
if err != nil {
return nil, fmt.Errorf("unable to get current node "+
"announcement: %v", err)
}
currentNodeAnn := s.cfg.GetNodeAnnouncement()
if len(req.FeatureUpdates) > 0 {
features, ops, err := s.updateFeatures(