Commit e50378f7 authored by zeroleak's avatar zeroleak
Browse files

remove cli.mix.mixsTarget from config on upgrade

parent 9a0eeeda
......@@ -2,7 +2,8 @@ package com.samourai.whirlpool.cli.beans;
public enum CliVersion {
VERSION_4(4),
VERSION_5(5);
VERSION_5(5),
VERSION_6(6);
private int version;
......
......@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
public class CliUpgradeService {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public static final CliVersion CURRENT_VERSION = CliVersion.VERSION_5;
public static final CliVersion CURRENT_VERSION = CliVersion.VERSION_6;
private CliConfig cliConfig;
private CliConfigService cliConfigService;
......@@ -60,6 +60,24 @@ public class CliUpgradeService {
return false;
}
});
// V6
this.upgrades.put(
CliVersion.VERSION_6.getVersion(),
new CliUpgradeAuth() {
@Override
public boolean run(CliWallet cliWallet) throws Exception {
// remove cli.mix.mixsTarget when present
Properties props = cliConfigService.loadProperties();
final String KEY_MIX_MIXSTARGET = "cli.mix.mixsTarget";
if (props.containsKey(KEY_MIX_MIXSTARGET)) {
props.remove(KEY_MIX_MIXSTARGET);
cliConfigService.saveProperties(props);
return true; // restart
}
return false;
}
});
}
public boolean upgradeUnauthenticated() throws Exception {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment