From c4e82d59ecd2b29512468bd73a98ac1449a1b9bd Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Mon, 18 Nov 2024 22:13:01 +0000 Subject: [PATCH] Pass filterProvidedBtcNodes and bannedBtcNodes to FederatedBtcNodeProvider --- .../bisq/core/btc/nodes/BtcNodesSetupPreferences.java | 4 +++- .../bisq/core/btc/nodes/FederatedBtcNodeProvider.java | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/nodes/BtcNodesSetupPreferences.java b/core/src/main/java/bisq/core/btc/nodes/BtcNodesSetupPreferences.java index 1df1447ca6..2a28fe708a 100644 --- a/core/src/main/java/bisq/core/btc/nodes/BtcNodesSetupPreferences.java +++ b/core/src/main/java/bisq/core/btc/nodes/BtcNodesSetupPreferences.java @@ -67,7 +67,9 @@ public List selectPreferredNodes(BtcNodes btcNodes) { case PROVIDED: default: List hardcodedBtcNodes = btcNodes.getProvidedBtcNodes(); - result = FederatedBtcNodeProvider.getNodes(hardcodedBtcNodes, config); + List filterProvidedBtcNodes = config.filterProvidedBtcNodes; + List bannedBtcNodes = config.bannedBtcNodes; + result = FederatedBtcNodeProvider.getNodes(hardcodedBtcNodes, filterProvidedBtcNodes, bannedBtcNodes); break; } diff --git a/core/src/main/java/bisq/core/btc/nodes/FederatedBtcNodeProvider.java b/core/src/main/java/bisq/core/btc/nodes/FederatedBtcNodeProvider.java index eafd8dd022..567986fea9 100644 --- a/core/src/main/java/bisq/core/btc/nodes/FederatedBtcNodeProvider.java +++ b/core/src/main/java/bisq/core/btc/nodes/FederatedBtcNodeProvider.java @@ -2,8 +2,6 @@ import bisq.network.p2p.NodeAddress; -import bisq.common.config.Config; - import java.util.List; import java.util.Objects; import java.util.Set; @@ -16,8 +14,10 @@ @Slf4j public class FederatedBtcNodeProvider { - static List getNodes(List hardcodedBtcNodes, Config config) { - Set filterProvidedBtcNodes = config.filterProvidedBtcNodes.stream() + static List getNodes(List hardcodedBtcNodes, + List filterProvidedBtcNodesConfig, + List bannedBtcNodesConfig) { + Set filterProvidedBtcNodes = filterProvidedBtcNodesConfig.stream() .filter(n -> !n.isEmpty()) .map(FederatedBtcNodeProvider::getNodeAddress) .filter(Objects::nonNull) @@ -25,7 +25,7 @@ static List getNodes(List hardcodedBtcNodes, .collect(Collectors.toSet()); hardcodedBtcNodes.addAll(filterProvidedBtcNodes); - Set bannedBtcNodeHostNames = config.bannedBtcNodes.stream() + Set bannedBtcNodeHostNames = bannedBtcNodesConfig.stream() .filter(n -> !n.isEmpty()) .map(FederatedBtcNodeProvider::getNodeAddress) .filter(Objects::nonNull)