From 3e3de26ac9b60e39d03be8c5f00a66dee2bed542 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 30 Nov 2017 22:32:53 -0800 Subject: [PATCH] discovery: set proper flag within createChanAnnouncement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this commit, we fix an existing bug within the createChanAnnouncement function. Before we would set the flag to be 0, or 1 depending on which edge it was. This was incorrect as since then additional flags have been defined. We now properly set the entire flag, rather than taking a shortcut. With this, we’ll properly advertise all ChannelUpdate announcements. --- discovery/utils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discovery/utils.go b/discovery/utils.go index 80b889dd..7a5a79ba 100644 --- a/discovery/utils.go +++ b/discovery/utils.go @@ -41,8 +41,8 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof, // networkMsgs. // Since it's up to a node's policy as to whether they advertise the - // edge in dire direction, we don't create an advertisement if the edge - // is nil. + // edge in a direction, we don't create an advertisement if the edge is + // nil. var edge1Ann, edge2Ann *lnwire.ChannelUpdate if e1 != nil { edge1Ann = &lnwire.ChannelUpdate{ @@ -50,7 +50,7 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof, ChainHash: chanInfo.ChainHash, ShortChannelID: chanID, Timestamp: uint32(e1.LastUpdate.Unix()), - Flags: 0, + Flags: e1.Flags, TimeLockDelta: e1.TimeLockDelta, HtlcMinimumMsat: e1.MinHTLC, BaseFee: uint32(e1.FeeBaseMSat), @@ -63,7 +63,7 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof, ChainHash: chanInfo.ChainHash, ShortChannelID: chanID, Timestamp: uint32(e2.LastUpdate.Unix()), - Flags: 1, + Flags: e2.Flags, TimeLockDelta: e2.TimeLockDelta, HtlcMinimumMsat: e2.MinHTLC, BaseFee: uint32(e2.FeeBaseMSat),