Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub out support for OpenOffer's triggerPrice in api #5076

Merged
merged 10 commits into from Jan 14, 2021
15 changes: 7 additions & 8 deletions core/src/main/java/bisq/core/api/CoreContext.java
Expand Up @@ -20,20 +20,19 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import static java.lang.Thread.currentThread;

@Singleton
@Slf4j
class CoreContext {
public class CoreContext {

@Getter
@Setter
private boolean isApiUser;

@Inject
public CoreContext() {
}

public boolean isApiUser() {
String threadName = currentThread().getName();
return threadName.equals("BisqDaemonMain") || threadName.contains("grpc");
}
}
6 changes: 5 additions & 1 deletion daemon/src/main/java/bisq/daemon/grpc/GrpcServer.java
Expand Up @@ -17,6 +17,8 @@

package bisq.daemon.grpc;

import bisq.core.api.CoreContext;

import bisq.common.UserThread;
import bisq.common.config.Config;

Expand Down Expand Up @@ -44,7 +46,8 @@ public class GrpcServer {
private final Server server;

@Inject
public GrpcServer(Config config,
public GrpcServer(CoreContext coreContext,
Config config,
PasswordAuthInterceptor passwordAuthInterceptor,
GrpcDisputeAgentsService disputeAgentsService,
GrpcOffersService offersService,
Expand All @@ -66,6 +69,7 @@ public GrpcServer(Config config,
.addService(walletsService)
.intercept(passwordAuthInterceptor)
.build();
coreContext.setApiUser(true);
}

public void start() {
Expand Down