Allow JSON-RPC commands without account param if only one account exists

This commit is contained in:
AsamK 2022-12-30 13:50:40 +01:00
parent 0702159596
commit 210466e7d9

View file

@ -87,7 +87,13 @@ public class SignalJsonRpcCommandHandler {
return runCommand(objectMapper, params, new CommandRunnerImpl<>(m, jsonRpcCommand)); return runCommand(objectMapper, params, new CommandRunnerImpl<>(m, jsonRpcCommand));
} }
final var manager = getManagerFromParams(params); var manager = getManagerFromParams(params);
if (manager == null) {
final var managers = c.getManagers();
if (managers.size() == 1) {
manager = managers.get(0);
}
}
if (manager != null) { if (manager != null) {
return runCommand(objectMapper, params, new CommandRunnerImpl<>(manager, jsonRpcCommand)); return runCommand(objectMapper, params, new CommandRunnerImpl<>(manager, jsonRpcCommand));
} else { } else {