From f14499858a1ce18ac23b0ea7572111714fe8a733 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 4 Nov 2024 11:48:33 +0800 Subject: [PATCH] chanfitness: exit early when there are no updates --- chanfitness/chaneventstore.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chanfitness/chaneventstore.go b/chanfitness/chaneventstore.go index 29a1df917da..4a759c79c56 100644 --- a/chanfitness/chaneventstore.go +++ b/chanfitness/chaneventstore.go @@ -584,5 +584,10 @@ func (c *ChannelEventStore) recordFlapCount() error { log.Debugf("recording flap count for: %v peers", len(updates)) + // Exit early if there are no updates. + if len(updates) == 0 { + return nil + } + return c.cfg.WriteFlapCount(updates) }