server: return copy of current node announcement instead of ref

This commit is contained in:
Johan T. Halseth authored and Olaoluwa Osuntokun committed 2017-08-08 12:29:27 -07:00
1 parent f13c81eb6a
commit c497a63f14
1 file changed
+3 -3
+3 -3
View File
@@ -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