Skip to content

Commit

Permalink
core: Don't add old filter to invalid filters if new signer banned
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alvasw committed Dec 28, 2023
1 parent 78ac425 commit d6aa5b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/bisq/core/filter/FilterManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d6aa5b1

Please sign in to comment.