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.
This commit is contained in:
Johan T. Halseth 2018-01-21 14:58:36 +01:00
parent 786ca6cc50
commit 3e01529de4
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -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