mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
If AutoConfirmSettings contain a retired address we reset to the default values
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
b8e3296a5e
commit
2e25342530
@ -29,8 +29,10 @@ import java.util.Optional;
|
||||
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 final class AutoConfirmSettings implements PersistablePayload {
|
||||
private long tradeLimit;
|
||||
private List<String> serviceAddresses;
|
||||
private String currencyCode;
|
||||
private List<Listener> listeners = new CopyOnWriteArrayList<>();
|
||||
private final List<Listener> listeners = new CopyOnWriteArrayList<>();
|
||||
|
||||
@SuppressWarnings("SameParameterValue")
|
||||
static Optional<AutoConfirmSettings> getDefault(List<String> serviceAddresses, String currencyCode) {
|
||||
|
@ -378,12 +378,20 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
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<String> 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.
|
||||
|
Loading…
Reference in New Issue
Block a user