New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gossiper] Ignore received ChannelAnnouncements for own channels #4899
[gossiper] Ignore received ChannelAnnouncements for own channels #4899
Conversation
42be9da
to
094b259
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
@@ -544,7 +544,7 @@ func (d *AuthenticatedGossiper) ProcessRemoteAnnouncement(msg lnwire.Message, | |||
// entire channel announcement and update messages will be re-constructed and | |||
// broadcast to the rest of the network. | |||
func (d *AuthenticatedGossiper) ProcessLocalAnnouncement(msg lnwire.Message, | |||
source *btcec.PublicKey, optionalFields ...OptionalMsgField) chan error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
hmm unit tests are unhappy |
// To avoid inserting edges in the graph for our own channels that we | ||
// have already closed, we ignore such channel announcements coming | ||
// from the remote. | ||
case *lnwire.ChannelAnnouncement: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I guess this could happen after SCB recovery, the channel isn't yet closed, but we learn about it? I wonder why this didn't show up in any of the SCB itests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can also happen just after you have closed a channel, then someone send you the announcement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was meant to be a comment...
Uh, yeah need to fix the unit tests. |
094b259
to
fb77b2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍄
359711d
to
d335992
Compare
Needs a rebase! |
d335992
to
c04d32f
Compare
It will be the same announcement, no need to distinguish.
To make it more clear what is local and remote messages, we change to use `selfKey` only for local messages.
To avoid learning about our own channel we have already closed and removed from our graph, we ignore all ChannelAnns for channels we are involved in.
c04d32f
to
926005a
Compare
Fixes #4690