dockerize deamons with docker compose

This commit is contained in:
napoly 2022-11-18 20:47:07 +01:00 committed by woodser
parent f11c816cda
commit 217e7e03a2
4 changed files with 15 additions and 14 deletions

View file

@ -92,14 +92,14 @@ public class CoreAccountService {
if (accountExists()) throw new IllegalStateException("Cannot create account if account already exists");
keyRing.generateKeys(password);
this.password = password;
for (AccountServiceListener listener : listeners) listener.onAccountCreated();
for (AccountServiceListener listener : new ArrayList<AccountServiceListener>(listeners)) listener.onAccountCreated();
}
public void openAccount(String password) throws IncorrectPasswordException {
if (!accountExists()) throw new IllegalStateException("Cannot open account if account does not exist");
if (keyRing.unlockKeys(password, false)) {
this.password = password;
for (AccountServiceListener listener : listeners) listener.onAccountOpened();
for (AccountServiceListener listener : new ArrayList<AccountServiceListener>(listeners)) listener.onAccountOpened();
} else {
throw new IllegalStateException("keyRing.unlockKeys() returned false, that should never happen");
}
@ -110,13 +110,13 @@ public class CoreAccountService {
String oldPassword = this.password;
keyStorage.saveKeyRing(keyRing, oldPassword, password);
this.password = password;
for (AccountServiceListener listener : listeners) listener.onPasswordChanged(oldPassword, password);
for (AccountServiceListener listener : new ArrayList<AccountServiceListener>(listeners)) listener.onPasswordChanged(oldPassword, password);
}
public void closeAccount() {
if (!isAccountOpen()) throw new IllegalStateException("Cannot close unopened account");
keyRing.lockKeys(); // closed account means the keys are locked
for (AccountServiceListener listener : listeners) listener.onAccountClosed();
for (AccountServiceListener listener : new ArrayList<AccountServiceListener>(listeners)) listener.onAccountClosed();
}
public void backupAccount(int bufferSize, Consumer<InputStream> consume, Consumer<Exception> error) {

View file

@ -23,7 +23,6 @@ import com.google.inject.Inject;
import javax.inject.Named;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@ -35,7 +34,7 @@ import javax.annotation.Nullable;
@Slf4j
public class ProvidersRepository {
private static final List<String> DEFAULT_NODES = Arrays.asList(
private static final List<String> DEFAULT_NODES = List.of(
"http://gbmks3wzvdzu5xq6gnqpj2qz3262tcr36iltagk37udcbwzsbfazq3yd.onion/" // Haveno
);
@ -104,8 +103,8 @@ public class ProvidersRepository {
if (useLocalhostForP2P) {
// If we run in localhost mode we don't have the tor node running, so we need a clearnet host
// Use localhost for using a locally running provider
// providers = Collections.singletonList("http://localhost:8078");
providers = Collections.singletonList("https://price.haveno.network/"); // Haveno
providers = List.of("http://localhost:8078/", "https://price.haveno.network/");
} else {
providers = DEFAULT_NODES;
}