From ced28c4376e15616eb0b8eb437fff67aa129b603 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Mon, 21 Oct 2024 11:01:01 +0300 Subject: [PATCH] skip the update only last sent the serial is larger Signed-off-by: bcmmbaga --- management/server/updatechannel.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/server/updatechannel.go b/management/server/updatechannel.go index 760ae5071..5f636820b 100644 --- a/management/server/updatechannel.go +++ b/management/server/updatechannel.go @@ -69,7 +69,7 @@ func (p *PeersUpdateManager) SendUpdate(ctx context.Context, peerID string, upda if update.NetworkMap != nil { lastSentUpdate := p.peerUpdateMessage[peerID] - if lastSentUpdate != nil && lastSentUpdate.Update.NetworkMap.GetSerial() >= update.Update.NetworkMap.GetSerial() { + if lastSentUpdate != nil && lastSentUpdate.Update.NetworkMap.GetSerial() > update.Update.NetworkMap.GetSerial() { log.WithContext(ctx).Debugf("peer %s new network map serial: %d not greater than last sent: %d, skip sending update", peerID, update.Update.NetworkMap.GetSerial(), lastSentUpdate.Update.NetworkMap.GetSerial()) return @@ -225,7 +225,7 @@ func (p *PeersUpdateManager) handlePeerMessageUpdate(ctx context.Context, peerID // isNewPeerUpdateMessage checks if the given current update message is a new update that should be sent. func isNewPeerUpdateMessage(lastSentUpdate, currUpdateToSend *UpdateMessage) (bool, error) { - if lastSentUpdate.Update.NetworkMap.GetSerial() >= currUpdateToSend.Update.NetworkMap.GetSerial() { + if lastSentUpdate.Update.NetworkMap.GetSerial() > currUpdateToSend.Update.NetworkMap.GetSerial() { return false, nil }