discovery: broadcast OG chan ann in retransmitStaleChannels

This commit is contained in:
Olaoluwa Osuntokun 2017-10-04 20:33:03 -07:00
parent 0d28bb14cb
commit 490e0d0f46
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -529,11 +529,18 @@ func (d *AuthenticatedGossiper) retransmitStaleChannels() error {
for _, chanToUpdate := range edgesToUpdate { for _, chanToUpdate := range edgesToUpdate {
// Re-sign and update the channel on disk and retrieve our // Re-sign and update the channel on disk and retrieve our
// ChannelUpdate to broadcast. // ChannelUpdate to broadcast.
chanUpdate, err := d.updateChannel(chanToUpdate.info, chanAnn, chanUpdate, err := d.updateChannel(chanToUpdate.info,
chanToUpdate.edge) chanToUpdate.edge)
if err != nil { if err != nil {
return fmt.Errorf("unable to update channel: %v", err) return fmt.Errorf("unable to update channel: %v", err)
} }
// If we have a valid announcement to transmit, then we'll send
// that along with the update.
if chanAnn != nil {
signedUpdates = append(signedUpdates, chanAnn)
}
signedUpdates = append(signedUpdates, chanUpdate) signedUpdates = append(signedUpdates, chanUpdate)
} }
@ -543,9 +550,7 @@ func (d *AuthenticatedGossiper) retransmitStaleChannels() error {
return nil return nil
} }
log.Infof("Retransmitting %v outgoing channels", len(signedUpdates)) log.Infof("Retransmitting %v outgoing channels", len(edgesToUpdate))
// TODO(roasbeef): also send the channel ann?
// With all the wire announcements properly crafted, we'll broadcast // With all the wire announcements properly crafted, we'll broadcast
// our known outgoing channels to all our immediate peers. // our known outgoing channels to all our immediate peers.
@ -595,13 +600,12 @@ func (d *AuthenticatedGossiper) processFeeChanUpdate(feeUpdate *feeUpdateRequest
// Re-sign and update the backing ChannelGraphSource, and // Re-sign and update the backing ChannelGraphSource, and
// retrieve our ChannelUpdate to broadcast. // retrieve our ChannelUpdate to broadcast.
chanUpdate, err := d.updateChannel(info, edge) _, chanUpdate, err := d.updateChannel(info, edge)
if err != nil { if err != nil {
return err return err
} }
chanUpdates = append(chanUpdates, chanUpdate) chanUpdates = append(chanUpdates, chanUpdate)
return nil return nil
}) })
if err != nil { if err != nil {