From 3e01529de45a103aedcc4a9ae7ccca466a6faed6 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Sun, 21 Jan 2018 14:58:36 +0100 Subject: [PATCH] discovery/gossiper: don't reset batch after broadcast This commit fixes a bug that could cause annoucements to get lost, and resultet in flaky integration tests. After a set of announcements was broadcastet, we would reset (clear) the announcement batch, making any annoucement that was added between the call to Emit() and Reset() to be deleted, without ever being broadcast. We can just remove the Reset() call, as the batch will actually be reset within the call to Emit(), making the previous call only delete those messages we hadn't sent yet. --- discovery/gossiper.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 26ce951a..5555ca30 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -972,11 +972,6 @@ func (d *AuthenticatedGossiper) networkHandler() { } } - // If we're able to broadcast the current batch - // successfully, then we reset the batch for a new - // round of announcements. - announcements.Reset() - // The retransmission timer has ticked which indicates that we // should check if we need to prune or re-broadcast any of our // personal channels. This addresses the case of "zombie" channels and