mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-16 19:26:39 +02:00
discovery: set proper flag within createChanAnnouncement
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.
This commit is contained in:
@@ -41,8 +41,8 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
|
|||||||
// networkMsgs.
|
// networkMsgs.
|
||||||
|
|
||||||
// Since it's up to a node's policy as to whether they advertise the
|
// 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
|
// edge in a direction, we don't create an advertisement if the edge is
|
||||||
// is nil.
|
// nil.
|
||||||
var edge1Ann, edge2Ann *lnwire.ChannelUpdate
|
var edge1Ann, edge2Ann *lnwire.ChannelUpdate
|
||||||
if e1 != nil {
|
if e1 != nil {
|
||||||
edge1Ann = &lnwire.ChannelUpdate{
|
edge1Ann = &lnwire.ChannelUpdate{
|
||||||
@@ -50,7 +50,7 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
|
|||||||
ChainHash: chanInfo.ChainHash,
|
ChainHash: chanInfo.ChainHash,
|
||||||
ShortChannelID: chanID,
|
ShortChannelID: chanID,
|
||||||
Timestamp: uint32(e1.LastUpdate.Unix()),
|
Timestamp: uint32(e1.LastUpdate.Unix()),
|
||||||
Flags: 0,
|
Flags: e1.Flags,
|
||||||
TimeLockDelta: e1.TimeLockDelta,
|
TimeLockDelta: e1.TimeLockDelta,
|
||||||
HtlcMinimumMsat: e1.MinHTLC,
|
HtlcMinimumMsat: e1.MinHTLC,
|
||||||
BaseFee: uint32(e1.FeeBaseMSat),
|
BaseFee: uint32(e1.FeeBaseMSat),
|
||||||
@@ -63,7 +63,7 @@ func createChanAnnouncement(chanProof *channeldb.ChannelAuthProof,
|
|||||||
ChainHash: chanInfo.ChainHash,
|
ChainHash: chanInfo.ChainHash,
|
||||||
ShortChannelID: chanID,
|
ShortChannelID: chanID,
|
||||||
Timestamp: uint32(e2.LastUpdate.Unix()),
|
Timestamp: uint32(e2.LastUpdate.Unix()),
|
||||||
Flags: 1,
|
Flags: e2.Flags,
|
||||||
TimeLockDelta: e2.TimeLockDelta,
|
TimeLockDelta: e2.TimeLockDelta,
|
||||||
HtlcMinimumMsat: e2.MinHTLC,
|
HtlcMinimumMsat: e2.MinHTLC,
|
||||||
BaseFee: uint32(e2.FeeBaseMSat),
|
BaseFee: uint32(e2.FeeBaseMSat),
|
||||||
|
Reference in New Issue
Block a user