From 599ccffecdea8a4287c2bd7ec7307499b05bb629 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 21 Feb 2018 10:59:00 +0200 Subject: [PATCH] shift the message history window at the end of the heartbeat --- gossipsub.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gossipsub.go b/gossipsub.go index 03cd928..3bce11c 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -324,8 +324,6 @@ func (gs *GossipSubRouter) heartbeatTimer() { } func (gs *GossipSubRouter) heartbeat() { - gs.mcache.Shift() - // flush pending control message from retries and gossip // that hasn't been piggybacked since the last heartbeat gs.flush() @@ -441,6 +439,9 @@ func (gs *GossipSubRouter) heartbeat() { } } } + + // advance the message history window + gs.mcache.Shift() } func (gs *GossipSubRouter) flush() {