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 committed by Olaoluwa Osuntokun
parent 555de44d9f
commit 904003fbcb

View File

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