diff --git a/core/src/main/java/bisq/core/user/AutoConfirmSettings.java b/core/src/main/java/bisq/core/user/AutoConfirmSettings.java index f94e0538492..742e9f5e656 100644 --- a/core/src/main/java/bisq/core/user/AutoConfirmSettings.java +++ b/core/src/main/java/bisq/core/user/AutoConfirmSettings.java @@ -29,8 +29,10 @@ import java.util.concurrent.CopyOnWriteArrayList; import lombok.Getter; +import lombok.ToString; import lombok.extern.slf4j.Slf4j; +@ToString @Slf4j @Getter public final class AutoConfirmSettings implements PersistablePayload { @@ -43,7 +45,7 @@ public interface Listener { private long tradeLimit; private List serviceAddresses; private String currencyCode; - private List listeners = new CopyOnWriteArrayList<>(); + private final List listeners = new CopyOnWriteArrayList<>(); @SuppressWarnings("SameParameterValue") static Optional getDefault(List serviceAddresses, String currencyCode) { diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index 79f387b368a..85c0d932ed0 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -378,12 +378,20 @@ private void setupPreferences() { setUsePriceNotifications(true); } - if (prefPayload.getAutoConfirmSettingsList().isEmpty()) { + // Remove retired XMR AutoConfirm address + var doApplyDefaults = prefPayload.getAutoConfirmSettingsList().stream() + .map(autoConfirmSettings -> autoConfirmSettings.getServiceAddresses().stream() + .anyMatch(address -> address.contains("monero3bec7m26vx6si6qo7q7imlaoz45ot5m2b5z2ppgoooo6jx2rqd"))) + .findAny() + .orElse(true); + if (doApplyDefaults) { + prefPayload.getAutoConfirmSettingsList().clear(); List defaultXmrTxProofServices = getDefaultXmrTxProofServices(); AutoConfirmSettings.getDefault(defaultXmrTxProofServices, "XMR") .ifPresent(xmrAutoConfirmSettings -> { getAutoConfirmSettingsList().add(xmrAutoConfirmSettings); }); + persistenceManager.forcePersistNow(); } // We set the capability in CoreNetworkCapabilities if the program argument is set.