diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 7930ecc17..d8e67ad61 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -736,7 +736,7 @@ func (d *AuthenticatedGossiper) retransmitStaleChannels() error { // If it's been a full day since we've re-broadcasted the // channel, add the channel to the set of edges we need to // update. - if timeElapsed >= broadcastInterval { + if timeElapsed >= broadcastInterval && info.AuthProof != nil { edgesToUpdate = append(edgesToUpdate, updateTuple{ info: info, edge: edge, @@ -1106,6 +1106,26 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(nMsg *networkMsg) []l return nil } + // If this is a local ChannelUpdate announcement, send it to + // our peer. + if !nMsg.isRemote { + // Get our peer's public key + var remotePeer *btcec.PublicKey + switch msg.Flags { + case 0: + remotePeer = chanInfo.NodeKey2 + case 1: + remotePeer = chanInfo.NodeKey1 + } + + // Send ChannelUpdate to remotePeer + if err = d.cfg.SendToPeer(remotePeer, msg); err != nil { + log.Errorf("unable to send channel update "+ + "message to peer: %x", + remotePeer.SerializeCompressed()) + } + } + // Channel update announcement was successfully processed and // now it can be broadcast to the rest of the network. However, // we'll only broadcast the channel update announcement if it