forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
discovery: send both local and remote anns in the same goroutine
This commit changes the sending of anns from using separate goroutines to always sending both local and remote announcements in the same goroutine. In addition, the local announcements are always sent first. This change is to fix the following case: 1. Alice and Bob have a channel 2. Alice receives Bob's NodeAnnouncement 3. Alice goes to broadcast the channel 4. The broadcast is split into a local and remote broadcast due to PR lightningnetwork#7239. Bob's NodeAnnouncement is in the remote batch. Everything else (ChannelAnnouncement, ChannelUpdate x2, and Alice's NodeAnnouncement) is in the local batch. 5. The remote batch (containing Bob's NodeAnnouncement) runs before the local batch since they are spawned in separate goroutines. This means that Alice sends Carol the NodeAnnouncement before Carol knows of the channel. In step 2), Bob's NodeAnnouncement (isRemote = true) replaces Bob's NodeAnnouncement that Alice was going to relay (isRemote = false) after processing the AnnouncementSignatures.
- Loading branch information
1 parent
b73cfc5
commit e34a088
Showing
2 changed files
with
39 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters