discovery: use source of ann upon confirmed channel ann batch

We do this instead of using the source of the AnnounceSignatures
message, as we filter out the source when broadcasting any
announcements, leading to the remote node not receiving our channel
update. Note that this is done more for the sake of correctness and to
address a flake within the integration tests, as channel updates are
sent directly and reliably to channel counterparts.
This commit is contained in:
Wilmer Paulino 2021-01-06 12:51:22 -08:00
parent 00d4e92362
commit 7ef1f3f636
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -2245,17 +2245,17 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(
source: nMsg.source, source: nMsg.source,
msg: chanAnn, msg: chanAnn,
}) })
if e1Ann != nil { if src, err := chanInfo.NodeKey1(); err == nil && e1Ann != nil {
announcements = append(announcements, networkMsg{ announcements = append(announcements, networkMsg{
peer: nMsg.peer, peer: nMsg.peer,
source: nMsg.source, source: src,
msg: e1Ann, msg: e1Ann,
}) })
} }
if e2Ann != nil { if src, err := chanInfo.NodeKey2(); err == nil && e2Ann != nil {
announcements = append(announcements, networkMsg{ announcements = append(announcements, networkMsg{
peer: nMsg.peer, peer: nMsg.peer,
source: nMsg.source, source: src,
msg: e2Ann, msg: e2Ann,
}) })
} }