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:
10 files changed
+94
-91
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user