mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-26 22:17:51 +01:00
discovery: create deDupedAnnouncements struct in gosspier.go
For Part 1 of Issue #275. Create isolated private struct in networkHandler goroutine that will de-duplicate announcements added to the batch. The struct contains maps for each of channel announcements, channel updates, and node announcements to keep track of unique announcements. The struct has a Reset method to reset stored announcements, an AddMsg(lnwire.Message) method to add a new message to the current batch, and a Batch method to return the set of de-duplicated announcements. Also fix a few minor typos.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
1f95b660b9
commit
39d38da732
@@ -449,7 +449,7 @@ func TestEdgeUpdateNotification(t *testing.T) {
|
||||
|
||||
// Create lookup map for notifications we are intending to receive. Entries
|
||||
// are removed from the map when the anticipated notification is received.
|
||||
var waitingFor = map[vertex]int{
|
||||
var waitingFor = map[Vertex]int{
|
||||
newVertex(node1.PubKey): 1,
|
||||
newVertex(node2.PubKey): 2,
|
||||
}
|
||||
@@ -608,7 +608,7 @@ func TestNodeUpdateNotification(t *testing.T) {
|
||||
|
||||
// Create lookup map for notifications we are intending to receive. Entries
|
||||
// are removed from the map when the anticipated notification is received.
|
||||
var waitingFor = map[vertex]int{
|
||||
var waitingFor = map[Vertex]int{
|
||||
newVertex(node1.PubKey): 1,
|
||||
newVertex(node2.PubKey): 2,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user