From d6aa5b16f6da175a696fe3e3455edec73f1280f1 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Thu, 28 Dec 2023 15:00:21 +0100 Subject: [PATCH] core: Don't add old filter to invalid filters if new signer banned Before this change, the currentFilter will be added to the invalidFilters list after comparing both filters creation date and before checking whether the new filter was created by a banned signer. Note: The invalid filters list is only used on the security manager Bisq instances. This list is never read by regular user clients. --- core/src/main/java/bisq/core/filter/FilterManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/bisq/core/filter/FilterManager.java b/core/src/main/java/bisq/core/filter/FilterManager.java index fcb49f783e9..6384e2c659a 100644 --- a/core/src/main/java/bisq/core/filter/FilterManager.java +++ b/core/src/main/java/bisq/core/filter/FilterManager.java @@ -60,7 +60,6 @@ import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -547,16 +546,17 @@ private void onFilterAddedFromNetwork(Filter newFilter) { addToInvalidFilters(newFilter); return; - } else { - log.info("We received a new filter from the network and the creation date is newer than the " + - "filter we have already. We ignore the old filter."); - addToInvalidFilters(currentFilter); } if (isPrivilegedDevPubKeyBanned(newFilter.getSignerPubKeyAsHex())) { log.warn("Pub key of filter is banned. currentFilter={}, newFilter={}", currentFilter, newFilter); return; + } else { + log.info("We received a new filter with a newer creation date and the signer is not banned. " + + "We ignore the old filter."); + addToInvalidFilters(currentFilter); } + } // Our new filter is newer so we apply it.