From c497a63f14495b2ac7b7538fc62f26b11d238b76 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 8 Aug 2017 14:47:22 +0200 Subject: [PATCH] server: return copy of current node announcement instead of ref --- server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.go b/server.go index 90ec4655..702be32a 100644 --- a/server.go +++ b/server.go @@ -394,12 +394,12 @@ func (s *server) Stop() error { // genNodeAnnouncement generates and returns the current fully signed node // announcement. If refresh is true, then the time stamp of the announcement // will be updated in order to ensure it propagates through the network. -func (s *server) genNodeAnnouncement(refresh bool) (*lnwire.NodeAnnouncement, error) { +func (s *server) genNodeAnnouncement(refresh bool) (lnwire.NodeAnnouncement, error) { s.annMtx.Lock() defer s.annMtx.Unlock() if !refresh { - return s.currentNodeAnn, nil + return *s.currentNodeAnn, nil } var err error @@ -414,7 +414,7 @@ func (s *server) genNodeAnnouncement(refresh bool) (*lnwire.NodeAnnouncement, er s.nodeSigner, s.identityPriv.PubKey(), s.currentNodeAnn, ) - return s.currentNodeAnn, err + return *s.currentNodeAnn, err } // establishPersistentConnections attempts to establish persistent connections