mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Merge pull request #5137 from jmacxx/replace_deprecated_explorer
Replace deprecated bisq explorer settings
This commit is contained in:
commit
a520802399
@ -309,15 +309,25 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
useStandbyModeProperty.set(prefPayload.isUseStandbyMode());
|
||||
cssThemeProperty.set(prefPayload.getCssTheme());
|
||||
|
||||
// a list of previously-used federated explorers
|
||||
// if user preference references any deprecated explorers we need to select a new valid explorer
|
||||
String deprecatedExplorers = "(bsq.bisq.cc|bsq.vante.me|bsq.emzy.de|bsq.sqrrm.net|bsq.bisq.services|bsq.ninja).*";
|
||||
|
||||
// if no valid Bitcoin block explorer is set, select the 1st valid Bitcoin block explorer
|
||||
ArrayList<BlockChainExplorer> btcExplorers = getBlockChainExplorers();
|
||||
if (getBlockChainExplorer() == null || getBlockChainExplorer().name.length() == 0)
|
||||
if (getBlockChainExplorer() == null ||
|
||||
getBlockChainExplorer().name.length() == 0 ||
|
||||
getBlockChainExplorer().name.matches(deprecatedExplorers)) {
|
||||
setBlockChainExplorer(btcExplorers.get(0));
|
||||
}
|
||||
|
||||
// if no valid BSQ block explorer is set, randomly select a valid BSQ block explorer
|
||||
ArrayList<BlockChainExplorer> bsqExplorers = getBsqBlockChainExplorers();
|
||||
if (getBsqBlockChainExplorer() == null || getBsqBlockChainExplorer().name.length() == 0)
|
||||
if (getBsqBlockChainExplorer() == null ||
|
||||
getBsqBlockChainExplorer().name.length() == 0 ||
|
||||
getBsqBlockChainExplorer().name.matches(deprecatedExplorers)) {
|
||||
setBsqBlockChainExplorer(bsqExplorers.get((new Random()).nextInt(bsqExplorers.size())));
|
||||
}
|
||||
|
||||
tradeCurrenciesAsObservable.addAll(prefPayload.getFiatCurrencies());
|
||||
tradeCurrenciesAsObservable.addAll(prefPayload.getCryptoCurrencies());
|
||||
|
Loading…
Reference in New Issue
Block a user