fundingManager: let CurrentNodeAnnouncement return copy instead of ref

This commit is contained in:
Johan T. Halseth 2017-08-08 14:48:12 +02:00 committed by Olaoluwa Osuntokun
parent c497a63f14
commit 5c89ec6288
2 changed files with 3 additions and 3 deletions

@ -172,7 +172,7 @@ type fundingConfig struct {
// CurrentNodeAnnouncement should return the latest, fully signed node // CurrentNodeAnnouncement should return the latest, fully signed node
// announcement from the backing Lighting Network node. // announcement from the backing Lighting Network node.
CurrentNodeAnnouncement func() (*lnwire.NodeAnnouncement, error) CurrentNodeAnnouncement func() (lnwire.NodeAnnouncement, error)
// SendAnnouncement is used by the FundingManager to announce newly // SendAnnouncement is used by the FundingManager to announce newly
// created channels to the rest of the Lightning Network. // created channels to the rest of the Lightning Network.
@ -1413,7 +1413,7 @@ func (f *fundingManager) announceChannel(localIDKey, remoteIDKey, localFundingKe
fndgLog.Errorf("can't generate node announcement: %v", err) fndgLog.Errorf("can't generate node announcement: %v", err)
return return
} }
f.cfg.SendAnnouncement(nodeAnn) f.cfg.SendAnnouncement(&nodeAnn)
} }
// initFundingWorkflow sends a message to the funding manager instructing it // initFundingWorkflow sends a message to the funding manager instructing it

2
lnd.go

@ -136,7 +136,7 @@ func lndMain() error {
pubKey, msg, pubKey, msg,
) )
}, },
CurrentNodeAnnouncement: func() (*lnwire.NodeAnnouncement, error) { CurrentNodeAnnouncement: func() (lnwire.NodeAnnouncement, error) {
return server.genNodeAnnouncement(true) return server.genNodeAnnouncement(true)
}, },
SendAnnouncement: func(msg lnwire.Message) error { SendAnnouncement: func(msg lnwire.Message) error {