From 6d4ef9df85859f87cf6261b3675736245b8f6c8a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 22 Aug 2025 19:07:44 -0300 Subject: [PATCH] fix pool.FetchManyReplaceable() inverted logic. --- pool.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pool.go b/pool.go index d7d3fc2..4a08939 100644 --- a/pool.go +++ b/pool.go @@ -294,15 +294,15 @@ func (pool *Pool) FetchManyReplaceable( seenAlreadyLatest := xsync.NewMapOf[ReplaceableKey, Timestamp]() opts.CheckDuplicateReplaceable = func(rk ReplaceableKey, ts Timestamp) bool { - updated := false + discard := true seenAlreadyLatest.Compute(rk, func(latest Timestamp, _ bool) (newValue Timestamp, delete bool) { if ts > latest { - updated = true // we are updating the most recent + discard = false // we are going to use this, so don't discard it return ts, false } - return latest, false // the one we had was already more recent + return latest, false // the one we had was already more recent, so discard this }) - return updated + return discard } for _, url := range urls {