Commit c796203a authored by zeroleak's avatar zeroleak
Browse files

API: add POST /rest/cli/resync

parent 88f381d6
......@@ -262,4 +262,5 @@ Payload:
### reset config: ```DELETE /rest/cli/config```
### resync mix counters: ```POST /rest/cli/resync```
......@@ -15,6 +15,7 @@ import com.samourai.whirlpool.cli.services.CliConfigService;
import com.samourai.whirlpool.cli.services.CliUpgradeService;
import com.samourai.whirlpool.cli.services.CliWalletService;
import com.samourai.whirlpool.client.exception.NotifiableException;
import com.samourai.whirlpool.client.wallet.WhirlpoolWallet;
import java.lang.invoke.MethodHandles;
import javax.validation.Valid;
import org.slf4j.Logger;
......@@ -118,4 +119,13 @@ public class CliController extends AbstractRestController {
// success
return state(headers);
}
@RequestMapping(value = CliApiEndpoint.REST_CLI_RESYNC, method = RequestMethod.POST)
public void resync(@RequestHeader HttpHeaders headers) throws Exception {
checkHeaders(headers);
// resync mix counters
WhirlpoolWallet whirlpoolWallet = cliWalletService.getSessionWallet();
whirlpoolWallet.resync();
}
}
......@@ -8,6 +8,7 @@ public class CliApiEndpoint {
public static final String REST_CLI_LOGIN = REST_PREFIX + "cli/login";
public static final String REST_CLI_LOGOUT = REST_PREFIX + "cli/logout";
public static final String REST_CLI_RESTART = REST_PREFIX + "cli/restart";
public static final String REST_CLI_RESYNC = REST_PREFIX + "cli/resync";
public static final String REST_CLI_CONFIG = REST_PREFIX + "cli/config";
public static final String REST_POOLS = REST_PREFIX + "pools";
......@@ -33,6 +34,7 @@ public class CliApiEndpoint {
REST_CLI_LOGIN,
REST_CLI_LOGOUT,
REST_CLI_RESTART,
REST_CLI_RESYNC,
REST_CLI_CONFIG,
REST_POOLS,
REST_WALLET_DEPOSIT,
......
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