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
2023-04-05 10:21:59 +02:00
parent c6263c2fe6
commit 3f9f0ea5d1
10 changed files with 94 additions and 91 deletions

View File

@@ -263,8 +263,8 @@ type Config struct {
// GenNodeAnnouncement is used to send our node announcement to the remote
// on startup.
GenNodeAnnouncement func(bool,
...netann.NodeAnnModifier) (lnwire.NodeAnnouncement, error)
GenNodeAnnouncement func(...netann.NodeAnnModifier) (
lnwire.NodeAnnouncement, error)
// PrunePersistentPeerConnection is used to remove all internal state
// related to this peer in the server.
@@ -1036,7 +1036,7 @@ func (p *Brontide) maybeSendNodeAnn(channels []*channeldb.OpenChannel) {
return
}
ourNodeAnn, err := p.cfg.GenNodeAnnouncement(false)
ourNodeAnn, err := p.cfg.GenNodeAnnouncement()
if err != nil {
p.log.Debugf("Unable to retrieve node announcement: %v", err)
return