mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
Support for open JDK 20 by updating dependencies
This commit is contained in:
parent
6c7f9a288d
commit
5923a34ef9
257 changed files with 1487 additions and 1883 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
@ -17,10 +17,10 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 20
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '20'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
|
|
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
|
@ -35,6 +35,13 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up JDK 20
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '20'
|
||||||
|
distribution: 'adopt'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v2
|
||||||
|
|
2
.github/workflows/label.yml
vendored
2
.github/workflows/label.yml
vendored
|
@ -10,7 +10,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Bounty explanation
|
- name: Bounty explanation
|
||||||
uses: peter-evans/create-or-update-comment@v2
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
if: github.event.label.name == '💰bounty'
|
if: github.event.label.name == '💰bounty'
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
@ -10,7 +10,7 @@ buildscript {
|
||||||
classpath 'com.google.gradle:osdetector-gradle-plugin:1.7.3'
|
classpath 'com.google.gradle:osdetector-gradle-plugin:1.7.3'
|
||||||
classpath 'com.github.johnrengelman:shadow:8.1.1'
|
classpath 'com.github.johnrengelman:shadow:8.1.1'
|
||||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.6.3'
|
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.6.3'
|
||||||
classpath 'com.gradle:gradle-enterprise-gradle-plugin:3.12.4' // added for windows build verification-metadata.xml error
|
classpath 'com.gradle:gradle-enterprise-gradle-plugin:3.13.4' // added for windows build verification-metadata.xml error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ configure(subprojects) {
|
||||||
fontawesomefxMaterialdesignfontVersion = '2.0.26-9.1.2'
|
fontawesomefxMaterialdesignfontVersion = '2.0.26-9.1.2'
|
||||||
grpcVersion = '1.42.1'
|
grpcVersion = '1.42.1'
|
||||||
gsonVersion = '2.8.5'
|
gsonVersion = '2.8.5'
|
||||||
guavaVersion = '30.1.1-jre'
|
guavaVersion = '32.1.1-jre'
|
||||||
guiceVersion = '4.2.2'
|
guiceVersion = '7.0.0'
|
||||||
moneroJavaVersion = '0.7.16'
|
moneroJavaVersion = '0.7.16'
|
||||||
httpclient5Version = '5.0'
|
httpclient5Version = '5.0'
|
||||||
hamcrestVersion = '2.2'
|
hamcrestVersion = '2.2'
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.common;
|
package haveno.common;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
// Helps configure listener objects that are run by the `UserThread` each second
|
// Helps configure listener objects that are run by the `UserThread` each second
|
||||||
// and can do per second, per minute and delayed second actions. Also detects when we were in standby, and logs it.
|
// and can do per second, per minute and delayed second actions. Also detects when we were in standby, and logs it.
|
||||||
|
|
|
@ -17,16 +17,15 @@
|
||||||
|
|
||||||
package haveno.common.crypto;
|
package haveno.common.crypto;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
import java.security.KeyPair;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.security.KeyPair;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -18,15 +18,11 @@
|
||||||
package haveno.common.crypto;
|
package haveno.common.crypto;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.file.FileUtil;
|
import haveno.common.file.FileUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import static haveno.common.util.Preconditions.checkDir;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
@ -48,8 +44,10 @@ import java.security.spec.InvalidKeySpecException;
|
||||||
import java.security.spec.KeySpec;
|
import java.security.spec.KeySpec;
|
||||||
import java.security.spec.PKCS8EncodedKeySpec;
|
import java.security.spec.PKCS8EncodedKeySpec;
|
||||||
import java.security.spec.RSAPublicKeySpec;
|
import java.security.spec.RSAPublicKeySpec;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
import static haveno.common.util.Preconditions.checkDir;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KeyStorage uses password protection to save a symmetric key in PKCS#12 format.
|
* KeyStorage uses password protection to save a symmetric key in PKCS#12 format.
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
|
|
||||||
package haveno.common.file;
|
package haveno.common.file;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
|
|
||||||
package haveno.common.persistence;
|
package haveno.common.persistence;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.Timer;
|
import haveno.common.Timer;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
|
@ -30,13 +32,9 @@ import haveno.common.file.FileUtil;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.common.proto.persistable.PersistableEnvelope;
|
import haveno.common.proto.persistable.PersistableEnvelope;
|
||||||
import haveno.common.proto.persistable.PersistenceProtoResolver;
|
import haveno.common.proto.persistable.PersistenceProtoResolver;
|
||||||
import haveno.common.util.SingleThreadExecutorUtils;
|
|
||||||
import haveno.common.util.GcUtil;
|
import haveno.common.util.GcUtil;
|
||||||
import lombok.Getter;
|
import static haveno.common.util.Preconditions.checkDir;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import haveno.common.util.SingleThreadExecutorUtils;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -51,9 +49,9 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import lombok.Getter;
|
||||||
import static haveno.common.util.Preconditions.checkDir;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsible for reading persisted data and writing it on disk. We read usually only at start-up and keep data in RAM.
|
* Responsible for reading persisted data and writing it on disk. We read usually only at start-up and keep data in RAM.
|
||||||
|
|
|
@ -19,6 +19,7 @@ package haveno.core.account.sign;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.crypto.CryptoException;
|
import haveno.common.crypto.CryptoException;
|
||||||
import haveno.common.crypto.Hash;
|
import haveno.common.crypto.Hash;
|
||||||
|
@ -34,12 +35,6 @@ import haveno.network.p2p.BootstrapListener;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.storage.P2PDataStorage;
|
import haveno.network.p2p.storage.P2PDataStorage;
|
||||||
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
|
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.Coin;
|
|
||||||
import org.bitcoinj.core.ECKey;
|
|
||||||
import org.bitcoinj.core.Utils;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
import java.security.SignatureException;
|
import java.security.SignatureException;
|
||||||
|
@ -57,6 +52,10 @@ import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.Coin;
|
||||||
|
import org.bitcoinj.core.ECKey;
|
||||||
|
import org.bitcoinj.core.Utils;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SignedWitnessService {
|
public class SignedWitnessService {
|
||||||
|
|
|
@ -17,17 +17,16 @@
|
||||||
|
|
||||||
package haveno.core.account.sign;
|
package haveno.core.account.sign;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.network.p2p.storage.P2PDataStorage;
|
import haveno.network.p2p.storage.P2PDataStorage;
|
||||||
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
|
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
|
||||||
import haveno.network.p2p.storage.persistence.MapStoreService;
|
import haveno.network.p2p.storage.persistence.MapStoreService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SignedWitnessStorageService extends MapStoreService<SignedWitnessStore, PersistableNetworkPayload> {
|
public class SignedWitnessStorageService extends MapStoreService<SignedWitnessStore, PersistableNetworkPayload> {
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
package haveno.core.account.witness;
|
package haveno.core.account.witness;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.crypto.CryptoException;
|
import haveno.common.crypto.CryptoException;
|
||||||
import haveno.common.crypto.Hash;
|
import haveno.common.crypto.Hash;
|
||||||
|
@ -51,12 +53,6 @@ import haveno.network.p2p.BootstrapListener;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.storage.P2PDataStorage;
|
import haveno.network.p2p.storage.P2PDataStorage;
|
||||||
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
|
import haveno.network.p2p.storage.persistence.AppendOnlyDataStoreService;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.ECKey;
|
|
||||||
import org.bitcoinj.core.Utils;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
|
@ -74,8 +70,10 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
import lombok.Getter;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.ECKey;
|
||||||
|
import org.bitcoinj.core.Utils;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AccountAgeWitnessService {
|
public class AccountAgeWitnessService {
|
||||||
|
|
|
@ -17,15 +17,14 @@
|
||||||
|
|
||||||
package haveno.core.account.witness;
|
package haveno.core.account.witness;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
|
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
|
||||||
import haveno.network.p2p.storage.persistence.HistoricalDataStoreService;
|
import haveno.network.p2p.storage.persistence.HistoricalDataStoreService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AccountAgeWitnessStorageService extends HistoricalDataStoreService<AccountAgeWitnessStore> {
|
public class AccountAgeWitnessStorageService extends HistoricalDataStoreService<AccountAgeWitnessStore> {
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
package haveno.core.alert;
|
package haveno.core.alert;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
|
@ -26,22 +28,18 @@ import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.storage.HashMapChangedListener;
|
import haveno.network.p2p.storage.HashMapChangedListener;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStoragePayload;
|
import haveno.network.p2p.storage.payload.ProtectedStoragePayload;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.security.SignatureException;
|
||||||
|
import java.util.Collection;
|
||||||
import javafx.beans.property.ObjectProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import org.bitcoinj.core.ECKey;
|
import org.bitcoinj.core.ECKey;
|
||||||
import org.bitcoinj.core.Utils;
|
import org.bitcoinj.core.Utils;
|
||||||
|
import static org.bitcoinj.core.Utils.HEX;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.security.SignatureException;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import static org.bitcoinj.core.Utils.HEX;
|
|
||||||
|
|
||||||
public class AlertManager {
|
public class AlertManager {
|
||||||
private static final Logger log = LoggerFactory.getLogger(AlertManager.class);
|
private static final Logger log = LoggerFactory.getLogger(AlertManager.class);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ import com.google.common.util.concurrent.FutureCallback;
|
||||||
import com.google.common.util.concurrent.Futures;
|
import com.google.common.util.concurrent.Futures;
|
||||||
import com.google.common.util.concurrent.MoreExecutors;
|
import com.google.common.util.concurrent.MoreExecutors;
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
|
@ -37,25 +39,21 @@ import haveno.network.p2p.network.MessageListener;
|
||||||
import haveno.network.p2p.network.NetworkNode;
|
import haveno.network.p2p.network.NetworkNode;
|
||||||
import haveno.network.p2p.peers.keepalive.messages.Ping;
|
import haveno.network.p2p.peers.keepalive.messages.Ping;
|
||||||
import haveno.network.p2p.peers.keepalive.messages.Pong;
|
import haveno.network.p2p.peers.keepalive.messages.Pong;
|
||||||
import javafx.beans.property.ObjectProperty;
|
|
||||||
import javafx.beans.property.ReadOnlyObjectProperty;
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
|
||||||
import org.bitcoinj.core.ECKey;
|
|
||||||
import org.bitcoinj.core.Utils;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.security.SignatureException;
|
import java.security.SignatureException;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
import javafx.beans.property.ReadOnlyObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import org.bitcoinj.core.ECKey;
|
||||||
|
import org.bitcoinj.core.Utils;
|
||||||
import static org.bitcoinj.core.Utils.HEX;
|
import static org.bitcoinj.core.Utils.HEX;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class PrivateNotificationManager implements MessageListener {
|
public class PrivateNotificationManager implements MessageListener {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PrivateNotificationManager.class);
|
private static final Logger log = LoggerFactory.getLogger(PrivateNotificationManager.class);
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkState;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.IncorrectPasswordException;
|
import haveno.common.crypto.IncorrectPasswordException;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
|
@ -24,12 +27,6 @@ import haveno.common.crypto.KeyStorage;
|
||||||
import haveno.common.file.FileUtil;
|
import haveno.common.file.FileUtil;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.common.util.ZipUtils;
|
import haveno.common.util.ZipUtils;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.PipedInputStream;
|
import java.io.PipedInputStream;
|
||||||
|
@ -37,8 +34,9 @@ import java.io.PipedOutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import lombok.Getter;
|
||||||
import static com.google.common.base.Preconditions.checkState;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages the account state. A created account must have a password which encrypts
|
* Manages the account state. A created account must have a password which encrypts
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.IncorrectPasswordException;
|
import haveno.common.crypto.IncorrectPasswordException;
|
||||||
|
@ -45,15 +47,6 @@ import haveno.core.trade.statistics.TradeStatistics3;
|
||||||
import haveno.core.trade.statistics.TradeStatisticsManager;
|
import haveno.core.trade.statistics.TradeStatisticsManager;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.MoneroNodeSettings;
|
||||||
import haveno.proto.grpc.NotificationMessage;
|
import haveno.proto.grpc.NotificationMessage;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import monero.common.MoneroRpcConnection;
|
|
||||||
import monero.wallet.model.MoneroDestination;
|
|
||||||
import monero.wallet.model.MoneroTxWallet;
|
|
||||||
import org.bitcoinj.core.Transaction;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
@ -63,6 +56,12 @@ import java.util.Set;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import monero.common.MoneroRpcConnection;
|
||||||
|
import monero.wallet.model.MoneroDestination;
|
||||||
|
import monero.wallet.model.MoneroTxWallet;
|
||||||
|
import org.bitcoinj.core.Transaction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides high level interface to functionality of core Haveno features.
|
* Provides high level interface to functionality of core Haveno features.
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class CoreContext {
|
public class CoreContext {
|
||||||
|
|
|
@ -17,11 +17,17 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.core.support.SupportType;
|
import haveno.core.support.SupportType;
|
||||||
|
import static haveno.core.support.SupportType.ARBITRATION;
|
||||||
|
import static haveno.core.support.SupportType.MEDIATION;
|
||||||
|
import static haveno.core.support.SupportType.REFUND;
|
||||||
|
import static haveno.core.support.SupportType.TRADE;
|
||||||
import haveno.core.support.dispute.arbitration.arbitrator.Arbitrator;
|
import haveno.core.support.dispute.arbitration.arbitrator.Arbitrator;
|
||||||
import haveno.core.support.dispute.arbitration.arbitrator.ArbitratorManager;
|
import haveno.core.support.dispute.arbitration.arbitrator.ArbitratorManager;
|
||||||
import haveno.core.support.dispute.mediation.mediator.Mediator;
|
import haveno.core.support.dispute.mediation.mediator.Mediator;
|
||||||
|
@ -32,24 +38,16 @@ import haveno.core.user.User;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static java.lang.String.format;
|
||||||
import org.bitcoinj.core.ECKey;
|
import static java.net.InetAddress.getLoopbackAddress;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import static java.util.Arrays.asList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static haveno.core.support.SupportType.ARBITRATION;
|
import org.bitcoinj.core.ECKey;
|
||||||
import static haveno.core.support.SupportType.MEDIATION;
|
|
||||||
import static haveno.core.support.SupportType.REFUND;
|
|
||||||
import static haveno.core.support.SupportType.TRADE;
|
|
||||||
import static java.lang.String.format;
|
|
||||||
import static java.net.InetAddress.getLoopbackAddress;
|
|
||||||
import static java.util.Arrays.asList;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import com.google.inject.name.Named;
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.common.crypto.PubKeyRing;
|
import haveno.common.crypto.PubKeyRing;
|
||||||
|
@ -23,18 +26,13 @@ import haveno.core.trade.TradeManager;
|
||||||
import haveno.core.util.FormattingUtils;
|
import haveno.core.util.FormattingUtils;
|
||||||
import haveno.core.util.coin.CoinFormatter;
|
import haveno.core.util.coin.CoinFormatter;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static java.lang.String.format;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
import static java.lang.String.format;
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,18 +17,16 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
import static java.io.File.separator;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
import static java.io.File.separator;
|
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.lang.System.out;
|
import static java.lang.System.out;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -1,18 +1,24 @@
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.xmr.model.EncryptedConnectionList;
|
import haveno.core.xmr.model.EncryptedConnectionList;
|
||||||
import haveno.core.xmr.nodes.XmrNodes;
|
import haveno.core.xmr.nodes.XmrNodes;
|
||||||
import haveno.core.xmr.nodes.XmrNodesSetupPreferences;
|
|
||||||
import haveno.core.xmr.nodes.XmrNodes.XmrNode;
|
import haveno.core.xmr.nodes.XmrNodes.XmrNode;
|
||||||
|
import haveno.core.xmr.nodes.XmrNodesSetupPreferences;
|
||||||
import haveno.core.xmr.setup.DownloadListener;
|
import haveno.core.xmr.setup.DownloadListener;
|
||||||
import haveno.core.xmr.setup.WalletsSetup;
|
import haveno.core.xmr.setup.WalletsSetup;
|
||||||
import haveno.network.Socks5ProxyProvider;
|
import haveno.network.Socks5ProxyProvider;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.P2PServiceListener;
|
import haveno.network.p2p.P2PServiceListener;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
import javafx.beans.property.LongProperty;
|
import javafx.beans.property.LongProperty;
|
||||||
import javafx.beans.property.ObjectProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
@ -32,13 +38,6 @@ import monero.daemon.MoneroDaemonRpc;
|
||||||
import monero.daemon.model.MoneroDaemonInfo;
|
import monero.daemon.model.MoneroDaemonInfo;
|
||||||
import monero.daemon.model.MoneroPeer;
|
import monero.daemon.model.MoneroPeer;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public final class CoreMoneroConnectionsService {
|
public final class CoreMoneroConnectionsService {
|
||||||
|
@ -555,7 +554,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
// numPeers.set(peers.get().size());
|
// numPeers.set(peers.get().size());
|
||||||
numPeers.set(lastInfo.getNumOutgoingConnections() + lastInfo.getNumIncomingConnections());
|
numPeers.set(lastInfo.getNumOutgoingConnections() + lastInfo.getNumIncomingConnections());
|
||||||
peers.set(new ArrayList<MoneroPeer>());
|
peers.set(new ArrayList<MoneroPeer>());
|
||||||
|
|
||||||
// log recovery message
|
// log recovery message
|
||||||
if (lastErrorTimestamp != null) {
|
if (lastErrorTimestamp != null) {
|
||||||
log.info("Successfully fetched daemon info after previous error");
|
log.info("Successfully fetched daemon info after previous error");
|
||||||
|
|
|
@ -16,23 +16,22 @@
|
||||||
*/
|
*/
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.config.BaseCurrencyNetwork;
|
import haveno.common.config.BaseCurrencyNetwork;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.MoneroNodeSettings;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import monero.common.MoneroUtils;
|
|
||||||
import monero.daemon.MoneroDaemonRpc;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import monero.common.MoneroUtils;
|
||||||
|
import monero.daemon.MoneroDaemonRpc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start and stop or connect to a local Monero node.
|
* Start and stop or connect to a local Monero node.
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.api.model.TradeInfo;
|
import haveno.core.api.model.TradeInfo;
|
||||||
import haveno.core.support.messages.ChatMessage;
|
import haveno.core.support.messages.ChatMessage;
|
||||||
import haveno.core.trade.Trade;
|
import haveno.core.trade.Trade;
|
||||||
import haveno.proto.grpc.NotificationMessage;
|
import haveno.proto.grpc.NotificationMessage;
|
||||||
import haveno.proto.grpc.NotificationMessage.NotificationType;
|
import haveno.proto.grpc.NotificationMessage.NotificationType;
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -17,8 +17,13 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
|
import static haveno.common.util.MathUtils.exactMultiply;
|
||||||
|
import static haveno.common.util.MathUtils.roundDoubleToLong;
|
||||||
|
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
import haveno.core.monetary.CryptoMoney;
|
import haveno.core.monetary.CryptoMoney;
|
||||||
import haveno.core.monetary.Price;
|
import haveno.core.monetary.Price;
|
||||||
|
@ -27,37 +32,30 @@ import haveno.core.offer.CreateOfferService;
|
||||||
import haveno.core.offer.Offer;
|
import haveno.core.offer.Offer;
|
||||||
import haveno.core.offer.OfferBookService;
|
import haveno.core.offer.OfferBookService;
|
||||||
import haveno.core.offer.OfferDirection;
|
import haveno.core.offer.OfferDirection;
|
||||||
|
import static haveno.core.offer.OfferDirection.BUY;
|
||||||
import haveno.core.offer.OfferFilterService;
|
import haveno.core.offer.OfferFilterService;
|
||||||
import haveno.core.offer.OfferFilterService.Result;
|
import haveno.core.offer.OfferFilterService.Result;
|
||||||
import haveno.core.offer.OfferUtil;
|
import haveno.core.offer.OfferUtil;
|
||||||
import haveno.core.offer.OpenOffer;
|
import haveno.core.offer.OpenOffer;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
|
import static haveno.core.payment.PaymentAccountUtil.isPaymentAccountValidForOffer;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.core.util.PriceUtil;
|
import haveno.core.util.PriceUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static java.lang.String.format;
|
||||||
import org.bitcoinj.core.Transaction;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import static java.util.Comparator.comparing;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static haveno.common.util.MathUtils.exactMultiply;
|
import org.bitcoinj.core.Transaction;
|
||||||
import static haveno.common.util.MathUtils.roundDoubleToLong;
|
|
||||||
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
|
||||||
import static haveno.core.offer.OfferDirection.BUY;
|
|
||||||
import static haveno.core.payment.PaymentAccountUtil.isPaymentAccountValidForOffer;
|
|
||||||
import static java.lang.String.format;
|
|
||||||
import static java.util.Comparator.comparing;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -17,13 +17,18 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.asset.Asset;
|
import haveno.asset.Asset;
|
||||||
import haveno.asset.AssetRegistry;
|
import haveno.asset.AssetRegistry;
|
||||||
|
import static haveno.common.config.Config.baseCurrencyNetwork;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.api.model.PaymentAccountForm;
|
import haveno.core.api.model.PaymentAccountForm;
|
||||||
import haveno.core.api.model.PaymentAccountFormField;
|
import haveno.core.api.model.PaymentAccountFormField;
|
||||||
import haveno.core.locale.CryptoCurrency;
|
import haveno.core.locale.CryptoCurrency;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
|
import static haveno.core.locale.CurrencyUtil.findAsset;
|
||||||
|
import static haveno.core.locale.CurrencyUtil.getCryptoCurrency;
|
||||||
import haveno.core.locale.TradeCurrency;
|
import haveno.core.locale.TradeCurrency;
|
||||||
import haveno.core.payment.AssetAccount;
|
import haveno.core.payment.AssetAccount;
|
||||||
import haveno.core.payment.CryptoCurrencyAccount;
|
import haveno.core.payment.CryptoCurrencyAccount;
|
||||||
|
@ -32,21 +37,14 @@ import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.payment.PaymentAccountFactory;
|
import haveno.core.payment.PaymentAccountFactory;
|
||||||
import haveno.core.payment.payload.PaymentMethod;
|
import haveno.core.payment.payload.PaymentMethod;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import static java.lang.String.format;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static haveno.common.config.Config.baseCurrencyNetwork;
|
|
||||||
import static haveno.core.locale.CurrencyUtil.findAsset;
|
|
||||||
import static haveno.core.locale.CurrencyUtil.getCryptoCurrency;
|
|
||||||
import static java.lang.String.format;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
import com.google.common.math.LongMath;
|
import com.google.common.math.LongMath;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.api.model.MarketDepthInfo;
|
import haveno.core.api.model.MarketDepthInfo;
|
||||||
import haveno.core.api.model.MarketPriceInfo;
|
import haveno.core.api.model.MarketPriceInfo;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
|
@ -27,16 +29,13 @@ import haveno.core.offer.OfferBookService;
|
||||||
import haveno.core.offer.OfferDirection;
|
import haveno.core.offer.OfferDirection;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.core.offer.Offer;
|
import haveno.core.offer.Offer;
|
||||||
|
@ -34,20 +36,16 @@ import haveno.core.trade.protocol.SellerProtocol;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.core.util.validation.BtcAddressValidator;
|
import haveno.core.util.validation.BtcAddressValidator;
|
||||||
import haveno.core.xmr.model.AddressEntry;
|
import haveno.core.xmr.model.AddressEntry;
|
||||||
|
import static haveno.core.xmr.model.AddressEntry.Context.TRADE_PAYOUT;
|
||||||
import haveno.core.xmr.wallet.BtcWalletService;
|
import haveno.core.xmr.wallet.BtcWalletService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static java.lang.String.format;
|
||||||
import org.bitcoinj.core.Coin;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static haveno.core.xmr.model.AddressEntry.Context.TRADE_PAYOUT;
|
import org.bitcoinj.core.Coin;
|
||||||
import static java.lang.String.format;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -20,6 +20,9 @@ package haveno.core.api;
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.Timer;
|
import haveno.common.Timer;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.core.api.model.AddressBalanceInfo;
|
import haveno.core.api.model.AddressBalanceInfo;
|
||||||
|
@ -29,13 +32,22 @@ import haveno.core.api.model.XmrBalanceInfo;
|
||||||
import haveno.core.app.AppStartupState;
|
import haveno.core.app.AppStartupState;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.util.FormattingUtils;
|
import haveno.core.util.FormattingUtils;
|
||||||
|
import static haveno.core.util.ParsingUtils.parseToCoin;
|
||||||
import haveno.core.util.coin.CoinFormatter;
|
import haveno.core.util.coin.CoinFormatter;
|
||||||
import haveno.core.xmr.Balances;
|
import haveno.core.xmr.Balances;
|
||||||
import haveno.core.xmr.model.AddressEntry;
|
import haveno.core.xmr.model.AddressEntry;
|
||||||
import haveno.core.xmr.setup.WalletsSetup;
|
import haveno.core.xmr.setup.WalletsSetup;
|
||||||
import haveno.core.xmr.wallet.BtcWalletService;
|
import haveno.core.xmr.wallet.BtcWalletService;
|
||||||
|
import static haveno.core.xmr.wallet.Restrictions.getMinNonDustOutput;
|
||||||
import haveno.core.xmr.wallet.WalletsManager;
|
import haveno.core.xmr.wallet.WalletsManager;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
|
import static java.lang.String.format;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import monero.wallet.model.MoneroDestination;
|
import monero.wallet.model.MoneroDestination;
|
||||||
import monero.wallet.model.MoneroTxWallet;
|
import monero.wallet.model.MoneroTxWallet;
|
||||||
|
@ -47,20 +59,6 @@ import org.bitcoinj.core.TransactionConfidence;
|
||||||
import org.bitcoinj.crypto.KeyCrypterScrypt;
|
import org.bitcoinj.crypto.KeyCrypterScrypt;
|
||||||
import org.bouncycastle.crypto.params.KeyParameter;
|
import org.bouncycastle.crypto.params.KeyParameter;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static haveno.core.util.ParsingUtils.parseToCoin;
|
|
||||||
import static haveno.core.xmr.wallet.Restrictions.getMinNonDustOutput;
|
|
||||||
import static java.lang.String.format;
|
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class CoreWalletsService {
|
class CoreWalletsService {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.CoreMoneroConnectionsService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.network.p2p.BootstrapListener;
|
import haveno.network.p2p.BootstrapListener;
|
||||||
|
@ -28,9 +30,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.fxmisc.easybind.EasyBind;
|
import org.fxmisc.easybind.EasyBind;
|
||||||
import org.fxmisc.easybind.monadic.MonadicBinding;
|
import org.fxmisc.easybind.monadic.MonadicBinding;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We often need to wait until network and wallet is ready or other combination of startup states.
|
* We often need to wait until network and wallet is ready or other combination of startup states.
|
||||||
* To avoid those repeated checks for the state or setting of listeners on different domains we provide here a
|
* To avoid those repeated checks for the state or setting of listeners on different domains we provide here a
|
||||||
|
|
|
@ -17,21 +17,13 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.file.FileUtil;
|
import haveno.common.file.FileUtil;
|
||||||
import haveno.common.file.ResourceNotFoundException;
|
import haveno.common.file.ResourceNotFoundException;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import javax.sound.sampled.AudioFormat;
|
|
||||||
import javax.sound.sampled.AudioInputStream;
|
|
||||||
import javax.sound.sampled.AudioSystem;
|
|
||||||
import javax.sound.sampled.DataLine;
|
|
||||||
import javax.sound.sampled.LineUnavailableException;
|
|
||||||
import javax.sound.sampled.SourceDataLine;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
@ -43,6 +35,13 @@ import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
import javax.sound.sampled.AudioFormat;
|
||||||
|
import javax.sound.sampled.AudioInputStream;
|
||||||
|
import javax.sound.sampled.AudioSystem;
|
||||||
|
import javax.sound.sampled.DataLine;
|
||||||
|
import javax.sound.sampled.LineUnavailableException;
|
||||||
|
import javax.sound.sampled.SourceDataLine;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevents that Haveno gets hibernated from the OS. On OSX there is a tool called caffeinate but it seems it does not
|
* Prevents that Haveno gets hibernated from the OS. On OSX there is a tool called caffeinate but it seems it does not
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.ClockWatcher;
|
import haveno.common.ClockWatcher;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.account.sign.SignedWitnessService;
|
import haveno.core.account.sign.SignedWitnessService;
|
||||||
|
@ -51,8 +52,6 @@ import haveno.core.user.User;
|
||||||
import haveno.core.xmr.Balances;
|
import haveno.core.xmr.Balances;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.mailbox.MailboxMessageService;
|
import haveno.network.p2p.mailbox.MailboxMessageService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.Timer;
|
import haveno.common.Timer;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
|
@ -62,23 +65,6 @@ import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
|
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
|
||||||
import haveno.network.utils.Utils;
|
import haveno.network.utils.Utils;
|
||||||
import javafx.beans.property.BooleanProperty;
|
|
||||||
import javafx.beans.property.DoubleProperty;
|
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
|
||||||
import javafx.beans.property.StringProperty;
|
|
||||||
import javafx.beans.value.ChangeListener;
|
|
||||||
import javafx.collections.SetChangeListener;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.Coin;
|
|
||||||
import org.fxmisc.easybind.EasyBind;
|
|
||||||
import org.fxmisc.easybind.monadic.MonadicBinding;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
|
@ -93,6 +79,19 @@ import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.DoubleProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.StringProperty;
|
||||||
|
import javafx.beans.value.ChangeListener;
|
||||||
|
import javafx.collections.SetChangeListener;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.Coin;
|
||||||
|
import org.fxmisc.easybind.EasyBind;
|
||||||
|
import org.fxmisc.easybind.monadic.MonadicBinding;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.CoreMoneroConnectionsService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
|
@ -27,20 +29,17 @@ import haveno.network.p2p.P2PServiceListener;
|
||||||
import haveno.network.p2p.network.CloseConnectionReason;
|
import haveno.network.p2p.network.CloseConnectionReason;
|
||||||
import haveno.network.p2p.network.Connection;
|
import haveno.network.p2p.network.Connection;
|
||||||
import haveno.network.p2p.network.ConnectionListener;
|
import haveno.network.p2p.network.ConnectionListener;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.fxmisc.easybind.EasyBind;
|
import org.fxmisc.easybind.EasyBind;
|
||||||
import org.fxmisc.easybind.monadic.MonadicBinding;
|
import org.fxmisc.easybind.monadic.MonadicBinding;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class P2PNetworkSetup {
|
public class P2PNetworkSetup {
|
||||||
|
|
|
@ -17,20 +17,18 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.file.FileUtil;
|
import haveno.common.file.FileUtil;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static haveno.common.util.Preconditions.checkDir;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import static haveno.common.util.Preconditions.checkDir;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.api.CoreContext;
|
import haveno.core.api.CoreContext;
|
||||||
|
@ -30,6 +32,8 @@ import haveno.core.xmr.exceptions.InvalidHostException;
|
||||||
import haveno.core.xmr.exceptions.RejectedTxException;
|
import haveno.core.xmr.exceptions.RejectedTxException;
|
||||||
import haveno.core.xmr.setup.WalletsSetup;
|
import haveno.core.xmr.setup.WalletsSetup;
|
||||||
import haveno.core.xmr.wallet.WalletsManager;
|
import haveno.core.xmr.wallet.WalletsManager;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.DoubleProperty;
|
import javafx.beans.property.DoubleProperty;
|
||||||
import javafx.beans.property.ObjectProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
@ -38,10 +42,10 @@ import javafx.beans.property.SimpleDoubleProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import monero.daemon.model.MoneroDaemonInfo;
|
import monero.daemon.model.MoneroDaemonInfo;
|
||||||
|
|
||||||
import org.bitcoinj.core.RejectMessage;
|
import org.bitcoinj.core.RejectMessage;
|
||||||
import org.bitcoinj.core.VersionMessage;
|
import org.bitcoinj.core.VersionMessage;
|
||||||
import org.bitcoinj.store.BlockStoreException;
|
import org.bitcoinj.store.BlockStoreException;
|
||||||
|
@ -49,12 +53,6 @@ import org.bitcoinj.store.ChainFileLockedException;
|
||||||
import org.fxmisc.easybind.EasyBind;
|
import org.fxmisc.easybind.EasyBind;
|
||||||
import org.fxmisc.easybind.monadic.MonadicBinding;
|
import org.fxmisc.easybind.monadic.MonadicBinding;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class WalletAppSetup {
|
public class WalletAppSetup {
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.app.misc;
|
package haveno.core.app.misc;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class AppSetup {
|
public abstract class AppSetup {
|
||||||
protected final Config config;
|
protected final Config config;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.app.misc;
|
package haveno.core.app.misc;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.common.proto.persistable.PersistedDataHost;
|
import haveno.common.proto.persistable.PersistedDataHost;
|
||||||
|
@ -31,13 +32,11 @@ import haveno.network.p2p.network.Connection;
|
||||||
import haveno.network.p2p.network.ConnectionListener;
|
import haveno.network.p2p.network.ConnectionListener;
|
||||||
import haveno.network.p2p.peers.PeerManager;
|
import haveno.network.p2p.peers.PeerManager;
|
||||||
import haveno.network.p2p.storage.P2PDataStorage;
|
import haveno.network.p2p.storage.P2PDataStorage;
|
||||||
|
import java.util.ArrayList;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AppSetupWithP2P extends AppSetup {
|
public class AppSetupWithP2P extends AppSetup {
|
||||||
protected final P2PService p2PService;
|
protected final P2PService p2PService;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.app.misc;
|
package haveno.core.app.misc;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.account.sign.SignedWitnessService;
|
import haveno.core.account.sign.SignedWitnessService;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
|
@ -27,8 +28,6 @@ import haveno.network.p2p.peers.PeerManager;
|
||||||
import haveno.network.p2p.storage.P2PDataStorage;
|
import haveno.network.p2p.storage.P2PDataStorage;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AppSetupWithP2PAndDAO extends AppSetupWithP2P {
|
public class AppSetupWithP2PAndDAO extends AppSetupWithP2P {
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.filter;
|
package haveno.core.filter;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
|
@ -35,16 +38,6 @@ import haveno.network.p2p.P2PServiceListener;
|
||||||
import haveno.network.p2p.network.BanFilter;
|
import haveno.network.p2p.network.BanFilter;
|
||||||
import haveno.network.p2p.storage.HashMapChangedListener;
|
import haveno.network.p2p.storage.HashMapChangedListener;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import javafx.beans.property.ObjectProperty;
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.ECKey;
|
|
||||||
import org.bitcoinj.core.Sha256Hash;
|
|
||||||
import org.bouncycastle.util.encoders.Base64;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -58,9 +51,14 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javafx.beans.property.ObjectProperty;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.ECKey;
|
||||||
|
import org.bitcoinj.core.Sha256Hash;
|
||||||
import static org.bitcoinj.core.Utils.HEX;
|
import static org.bitcoinj.core.Utils.HEX;
|
||||||
|
import org.bouncycastle.util.encoders.Base64;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We only support one active filter, if we receive multiple we use the one with the more recent creationDate.
|
* We only support one active filter, if we receive multiple we use the one with the more recent creationDate.
|
||||||
|
|
|
@ -17,17 +17,16 @@
|
||||||
|
|
||||||
package haveno.core.network;
|
package haveno.core.network;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.network.BanFilter;
|
import haveno.network.p2p.network.BanFilter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class CoreBanFilter implements BanFilter {
|
public class CoreBanFilter implements BanFilter {
|
||||||
|
|
|
@ -20,6 +20,8 @@ package haveno.core.network.p2p.inventory;
|
||||||
import com.google.common.base.Enums;
|
import com.google.common.base.Enums;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.proto.network.NetworkEnvelope;
|
import haveno.common.proto.network.NetworkEnvelope;
|
||||||
|
@ -37,13 +39,10 @@ import haveno.network.p2p.network.Statistic;
|
||||||
import haveno.network.p2p.peers.PeerManager;
|
import haveno.network.p2p.peers.PeerManager;
|
||||||
import haveno.network.p2p.storage.P2PDataStorage;
|
import haveno.network.p2p.storage.P2PDataStorage;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GetInventoryRequestHandler implements MessageListener {
|
public class GetInventoryRequestHandler implements MessageListener {
|
||||||
|
|
|
@ -17,16 +17,15 @@
|
||||||
|
|
||||||
package haveno.core.network.p2p.inventory;
|
package haveno.core.network.p2p.inventory;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import haveno.core.network.p2p.inventory.model.InventoryItem;
|
import haveno.core.network.p2p.inventory.model.InventoryItem;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.network.NetworkNode;
|
import haveno.network.p2p.network.NetworkNode;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GetInventoryRequestManager {
|
public class GetInventoryRequestManager {
|
||||||
|
|
|
@ -17,13 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.network.p2p.seed;
|
package haveno.core.network.p2p.seed;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.seed.SeedNodeRepository;
|
import haveno.network.p2p.seed.SeedNodeRepository;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
@ -35,6 +33,7 @@ import java.util.Optional;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
// If a new BaseCurrencyNetwork type gets added we need to add the resource file for it as well!
|
// If a new BaseCurrencyNetwork type gets added we need to add the resource file for it as well!
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -18,16 +18,15 @@
|
||||||
package haveno.core.notifications;
|
package haveno.core.notifications;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import com.google.inject.Inject;
|
||||||
import org.apache.commons.codec.binary.Base64;
|
import com.google.inject.Singleton;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.NoSuchPaddingException;
|
import javax.crypto.NoSuchPaddingException;
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import javax.inject.Inject;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import javax.inject.Singleton;
|
import org.apache.commons.codec.binary.Base64;
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -18,15 +18,14 @@
|
||||||
package haveno.core.notifications;
|
package haveno.core.notifications;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.notifications;
|
package haveno.core.notifications;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import com.google.common.util.concurrent.FutureCallback;
|
import com.google.common.util.concurrent.FutureCallback;
|
||||||
import com.google.common.util.concurrent.Futures;
|
import com.google.common.util.concurrent.Futures;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
@ -25,12 +27,15 @@ import com.google.common.util.concurrent.MoreExecutors;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.network.http.HttpClient;
|
import haveno.network.http.HttpClient;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
@ -38,13 +43,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.codec.binary.Hex;
|
import org.apache.commons.codec.binary.Hex;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MobileNotificationService {
|
public class MobileNotificationService {
|
||||||
|
|
|
@ -17,11 +17,10 @@
|
||||||
|
|
||||||
package haveno.core.notifications;
|
package haveno.core.notifications;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MobileNotificationValidator {
|
public class MobileNotificationValidator {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.notifications.alerts;
|
package haveno.core.notifications.alerts;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.notifications.MobileMessage;
|
import haveno.core.notifications.MobileMessage;
|
||||||
import haveno.core.notifications.MobileMessageType;
|
import haveno.core.notifications.MobileMessageType;
|
||||||
|
@ -27,14 +29,11 @@ import haveno.core.support.dispute.mediation.MediationManager;
|
||||||
import haveno.core.support.dispute.refund.RefundManager;
|
import haveno.core.support.dispute.refund.RefundManager;
|
||||||
import haveno.core.support.messages.ChatMessage;
|
import haveno.core.support.messages.ChatMessage;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
|
import java.util.UUID;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class DisputeMsgEvents {
|
public class DisputeMsgEvents {
|
||||||
|
|
|
@ -17,19 +17,18 @@
|
||||||
|
|
||||||
package haveno.core.notifications.alerts;
|
package haveno.core.notifications.alerts;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.notifications.MobileMessage;
|
import haveno.core.notifications.MobileMessage;
|
||||||
import haveno.core.notifications.MobileMessageType;
|
import haveno.core.notifications.MobileMessageType;
|
||||||
import haveno.core.notifications.MobileNotificationService;
|
import haveno.core.notifications.MobileNotificationService;
|
||||||
import haveno.core.offer.OpenOffer;
|
import haveno.core.offer.OpenOffer;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
|
import java.util.UUID;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MyOfferTakenEvents {
|
public class MyOfferTakenEvents {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.notifications.alerts;
|
package haveno.core.notifications.alerts;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.PubKeyRingProvider;
|
import haveno.common.crypto.PubKeyRingProvider;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.notifications.MobileMessage;
|
import haveno.core.notifications.MobileMessage;
|
||||||
|
@ -24,14 +26,11 @@ import haveno.core.notifications.MobileMessageType;
|
||||||
import haveno.core.notifications.MobileNotificationService;
|
import haveno.core.notifications.MobileNotificationService;
|
||||||
import haveno.core.trade.Trade;
|
import haveno.core.trade.Trade;
|
||||||
import haveno.core.trade.TradeManager;
|
import haveno.core.trade.TradeManager;
|
||||||
import javafx.collections.ListChangeListener;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import javafx.collections.ListChangeListener;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.notifications.alerts.market;
|
package haveno.core.notifications.alerts.market;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.common.util.MathUtils;
|
import haveno.common.util.MathUtils;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
|
@ -34,12 +36,9 @@ import haveno.core.provider.price.MarketPrice;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.core.util.FormattingUtils;
|
import haveno.core.util.FormattingUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.notifications.alerts.price;
|
package haveno.core.notifications.alerts.price;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.util.MathUtils;
|
import haveno.common.util.MathUtils;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
|
@ -31,9 +33,6 @@ import haveno.core.user.User;
|
||||||
import haveno.core.util.FormattingUtils;
|
import haveno.core.util.FormattingUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class PriceAlert {
|
public class PriceAlert {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.offer;
|
package haveno.core.offer;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.crypto.PubKeyRingProvider;
|
import haveno.common.crypto.PubKeyRingProvider;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
|
@ -38,15 +40,12 @@ import haveno.core.xmr.wallet.Restrictions;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.offer;
|
package haveno.core.offer;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import common.utils.GenUtils;
|
import common.utils.GenUtils;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
|
@ -34,15 +36,6 @@ import haveno.network.p2p.BootstrapListener;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.storage.HashMapChangedListener;
|
import haveno.network.p2p.storage.HashMapChangedListener;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import monero.common.MoneroConnectionManagerListener;
|
|
||||||
import monero.common.MoneroRpcConnection;
|
|
||||||
import monero.daemon.model.MoneroKeyImageSpentStatus;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -50,6 +43,12 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import monero.common.MoneroConnectionManagerListener;
|
||||||
|
import monero.common.MoneroRpcConnection;
|
||||||
|
import monero.daemon.model.MoneroKeyImageSpentStatus;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles storage and retrieval of offers.
|
* Handles storage and retrieval of offers.
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.offer;
|
package haveno.core.offer;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
|
@ -28,18 +30,15 @@ import haveno.core.user.Preferences;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import javafx.collections.SetChangeListener;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.Coin;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javafx.collections.SetChangeListener;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.Coin;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,9 +17,15 @@
|
||||||
|
|
||||||
package haveno.core.offer;
|
package haveno.core.offer;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.Capabilities;
|
import haveno.common.app.Capabilities;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.util.MathUtils;
|
import haveno.common.util.MathUtils;
|
||||||
|
import static haveno.common.util.MathUtils.roundDoubleToLong;
|
||||||
|
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
|
@ -28,8 +34,16 @@ import haveno.core.locale.Res;
|
||||||
import haveno.core.monetary.Price;
|
import haveno.core.monetary.Price;
|
||||||
import haveno.core.monetary.TraditionalMoney;
|
import haveno.core.monetary.TraditionalMoney;
|
||||||
import haveno.core.monetary.Volume;
|
import haveno.core.monetary.Volume;
|
||||||
import haveno.core.payment.PayByMailAccount;
|
import static haveno.core.offer.OfferPayload.ACCOUNT_AGE_WITNESS_HASH;
|
||||||
|
import static haveno.core.offer.OfferPayload.CAPABILITIES;
|
||||||
|
import static haveno.core.offer.OfferPayload.F2F_CITY;
|
||||||
|
import static haveno.core.offer.OfferPayload.F2F_EXTRA_INFO;
|
||||||
|
import static haveno.core.offer.OfferPayload.PAY_BY_MAIL_EXTRA_INFO;
|
||||||
|
import static haveno.core.offer.OfferPayload.REFERRAL_ID;
|
||||||
|
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF;
|
||||||
|
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF_ENABLED_VALUE;
|
||||||
import haveno.core.payment.F2FAccount;
|
import haveno.core.payment.F2FAccount;
|
||||||
|
import haveno.core.payment.PayByMailAccount;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.provider.price.MarketPrice;
|
import haveno.core.provider.price.MarketPrice;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
|
@ -38,34 +52,18 @@ import haveno.core.user.AutoConfirmSettings;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.util.coin.CoinFormatter;
|
import haveno.core.util.coin.CoinFormatter;
|
||||||
import haveno.core.xmr.wallet.BtcWalletService;
|
import haveno.core.xmr.wallet.BtcWalletService;
|
||||||
|
import static haveno.core.xmr.wallet.Restrictions.getMaxBuyerSecurityDepositAsPercent;
|
||||||
|
import static haveno.core.xmr.wallet.Restrictions.getMinBuyerSecurityDepositAsPercent;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.Transaction;
|
|
||||||
import org.bitcoinj.core.TransactionInput;
|
|
||||||
import org.bitcoinj.core.TransactionOutput;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import org.bitcoinj.core.Transaction;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import org.bitcoinj.core.TransactionInput;
|
||||||
import static haveno.common.util.MathUtils.roundDoubleToLong;
|
import org.bitcoinj.core.TransactionOutput;
|
||||||
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
|
||||||
import static haveno.core.offer.OfferPayload.ACCOUNT_AGE_WITNESS_HASH;
|
|
||||||
import static haveno.core.offer.OfferPayload.CAPABILITIES;
|
|
||||||
import static haveno.core.offer.OfferPayload.PAY_BY_MAIL_EXTRA_INFO;
|
|
||||||
import static haveno.core.offer.OfferPayload.F2F_CITY;
|
|
||||||
import static haveno.core.offer.OfferPayload.F2F_EXTRA_INFO;
|
|
||||||
import static haveno.core.offer.OfferPayload.REFERRAL_ID;
|
|
||||||
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF;
|
|
||||||
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF_ENABLED_VALUE;
|
|
||||||
import static haveno.core.xmr.wallet.Restrictions.getMaxBuyerSecurityDepositAsPercent;
|
|
||||||
import static haveno.core.xmr.wallet.Restrictions.getMinBuyerSecurityDepositAsPercent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class holds utility methods for creating, editing and taking an Offer.
|
* This class holds utility methods for creating, editing and taking an Offer.
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.offer;
|
package haveno.core.offer;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import common.utils.GenUtils;
|
import common.utils.GenUtils;
|
||||||
import haveno.common.Timer;
|
import haveno.common.Timer;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
|
@ -72,8 +74,22 @@ import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.SendDirectMessageListener;
|
import haveno.network.p2p.SendDirectMessageListener;
|
||||||
import haveno.network.p2p.peers.Broadcaster;
|
import haveno.network.p2p.peers.Broadcaster;
|
||||||
import haveno.network.p2p.peers.PeerManager;
|
import haveno.network.p2p.peers.PeerManager;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import monero.common.MoneroConnectionManagerListener;
|
import monero.common.MoneroConnectionManagerListener;
|
||||||
import monero.common.MoneroRpcConnection;
|
import monero.common.MoneroRpcConnection;
|
||||||
|
@ -90,24 +106,6 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMessageListener, PersistedDataHost {
|
public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMessageListener, PersistedDataHost {
|
||||||
private static final Logger log = LoggerFactory.getLogger(OpenOfferManager.class);
|
private static final Logger log = LoggerFactory.getLogger(OpenOfferManager.class);
|
||||||
|
|
||||||
|
@ -802,13 +800,13 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
resultHandler.handleResult(null);
|
resultHandler.handleResult(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get offer reserve amount
|
// get offer reserve amount
|
||||||
BigInteger offerReserveAmount = openOffer.getOffer().getReserveAmount();
|
BigInteger offerReserveAmount = openOffer.getOffer().getReserveAmount();
|
||||||
|
|
||||||
// handle split output offer
|
// handle split output offer
|
||||||
if (openOffer.isSplitOutput()) {
|
if (openOffer.isSplitOutput()) {
|
||||||
|
|
||||||
// get tx to fund split output
|
// get tx to fund split output
|
||||||
MoneroTxWallet splitOutputTx = findSplitOutputFundingTx(openOffers, openOffer);
|
MoneroTxWallet splitOutputTx = findSplitOutputFundingTx(openOffers, openOffer);
|
||||||
if (openOffer.getScheduledTxHashes() == null && splitOutputTx != null) {
|
if (openOffer.getScheduledTxHashes() == null && splitOutputTx != null) {
|
||||||
|
@ -841,7 +839,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// handle sufficient balance
|
// handle sufficient balance
|
||||||
boolean hasSufficientBalance = xmrWalletService.getWallet().getUnlockedBalance(0).compareTo(offerReserveAmount) >= 0;
|
boolean hasSufficientBalance = xmrWalletService.getWallet().getUnlockedBalance(0).compareTo(offerReserveAmount) >= 0;
|
||||||
if (hasSufficientBalance) {
|
if (hasSufficientBalance) {
|
||||||
|
@ -851,7 +849,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
scheduleOfferWithEarliestTxs(openOffers, openOffer);
|
scheduleOfferWithEarliestTxs(openOffers, openOffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle result
|
// handle result
|
||||||
resultHandler.handleResult(null);
|
resultHandler.handleResult(null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -17,7 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.offer;
|
package haveno.core.offer;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.util.MathUtils;
|
import haveno.common.util.MathUtils;
|
||||||
|
import static haveno.common.util.MathUtils.roundDoubleToLong;
|
||||||
|
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
import haveno.core.monetary.CryptoMoney;
|
import haveno.core.monetary.CryptoMoney;
|
||||||
import haveno.core.monetary.Price;
|
import haveno.core.monetary.Price;
|
||||||
|
@ -27,20 +31,14 @@ import haveno.core.provider.price.MarketPrice;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.network.p2p.BootstrapListener;
|
import haveno.network.p2p.BootstrapListener;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import javafx.collections.ListChangeListener;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import javafx.collections.ListChangeListener;
|
||||||
import static haveno.common.util.MathUtils.roundDoubleToLong;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,31 +17,29 @@
|
||||||
|
|
||||||
package haveno.core.offer.takeoffer;
|
package haveno.core.offer.takeoffer;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.taskrunner.Model;
|
import haveno.common.taskrunner.Model;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.monetary.Price;
|
import haveno.core.monetary.Price;
|
||||||
import haveno.core.monetary.Volume;
|
import haveno.core.monetary.Volume;
|
||||||
import haveno.core.offer.Offer;
|
import haveno.core.offer.Offer;
|
||||||
|
import static haveno.core.offer.OfferDirection.SELL;
|
||||||
import haveno.core.offer.OfferUtil;
|
import haveno.core.offer.OfferUtil;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.util.VolumeUtil;
|
import haveno.core.util.VolumeUtil;
|
||||||
import haveno.core.xmr.model.XmrAddressEntry;
|
import haveno.core.xmr.model.XmrAddressEntry;
|
||||||
|
import static haveno.core.xmr.model.XmrAddressEntry.Context.OFFER_FUNDING;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.Objects;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
import static haveno.core.offer.OfferDirection.SELL;
|
|
||||||
import static haveno.core.xmr.model.XmrAddressEntry.Context.OFFER_FUNDING;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TakeOfferModel implements Model {
|
public class TakeOfferModel implements Model {
|
||||||
// Immutable
|
// Immutable
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.payment;
|
package haveno.core.payment;
|
||||||
|
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.payment.payload.PaymentMethod;
|
import haveno.core.payment.payload.PaymentMethod;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ChargeBackRisk {
|
public class ChargeBackRisk {
|
||||||
public boolean hasChargebackRisk(String id, String currencyCode) {
|
public boolean hasChargebackRisk(String id, String currencyCode) {
|
||||||
|
|
|
@ -18,16 +18,15 @@
|
||||||
package haveno.core.payment;
|
package haveno.core.payment;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.util.MathUtils;
|
import haveno.common.util.MathUtils;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class TradeLimits {
|
public class TradeLimits {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class AdvancedCashValidator extends InputValidator {
|
public class AdvancedCashValidator extends InputValidator {
|
||||||
private EmailValidator emailValidator;
|
private EmailValidator emailValidator;
|
||||||
private RegexValidator regexValidator;
|
private RegexValidator regexValidator;
|
||||||
|
|
|
@ -18,11 +18,10 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public final class AustraliaPayidAccountNameValidator extends InputValidator {
|
public final class AustraliaPayidAccountNameValidator extends InputValidator {
|
||||||
@Override
|
@Override
|
||||||
public ValidationResult validate(String input) {
|
public ValidationResult validate(String input) {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class CapitualValidator extends InputValidator {
|
public class CapitualValidator extends InputValidator {
|
||||||
private final RegexValidator regexValidator;
|
private final RegexValidator regexValidator;
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.util.validation.MonetaryValidator;
|
import haveno.core.util.validation.MonetaryValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class FiatVolumeValidator extends MonetaryValidator {
|
public class FiatVolumeValidator extends MonetaryValidator {
|
||||||
@Override
|
@Override
|
||||||
public double getMinValue() {
|
public double getMinValue() {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class InteracETransferAnswerValidator extends InputValidator {
|
public class InteracETransferAnswerValidator extends InputValidator {
|
||||||
private LengthValidator lengthValidator;
|
private LengthValidator lengthValidator;
|
||||||
private RegexValidator regexValidator;
|
private RegexValidator regexValidator;
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class InteracETransferQuestionValidator extends InputValidator {
|
public class InteracETransferQuestionValidator extends InputValidator {
|
||||||
private LengthValidator lengthValidator;
|
private LengthValidator lengthValidator;
|
||||||
private RegexValidator regexValidator;
|
private RegexValidator regexValidator;
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Interac e-Transfer requires a mail address or Canadian (mobile) phone number
|
* Interac e-Transfer requires a mail address or Canadian (mobile) phone number
|
||||||
*
|
*
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.payment.JapanBankData;
|
import haveno.core.payment.JapanBankData;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public final class JapanBankAccountNameValidator extends InputValidator
|
public final class JapanBankAccountNameValidator extends InputValidator
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.payment.JapanBankData;
|
import haveno.core.payment.JapanBankData;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.core.util.validation.RegexValidator;
|
import haveno.core.util.validation.RegexValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public final class JapanBankBranchNameValidator extends InputValidator
|
public final class JapanBankBranchNameValidator extends InputValidator
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.util.FormattingUtils;
|
import haveno.core.util.FormattingUtils;
|
||||||
|
@ -24,8 +25,6 @@ import haveno.core.util.ParsingUtils;
|
||||||
import haveno.core.util.validation.NumberValidator;
|
import haveno.core.util.validation.NumberValidator;
|
||||||
import haveno.core.xmr.wallet.Restrictions;
|
import haveno.core.xmr.wallet.Restrictions;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class SecurityDepositValidator extends NumberValidator {
|
public class SecurityDepositValidator extends NumberValidator {
|
||||||
|
|
||||||
private PaymentAccount paymentAccount;
|
private PaymentAccount paymentAccount;
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public final class TransferwiseValidator extends InputValidator {
|
public final class TransferwiseValidator extends InputValidator {
|
||||||
private final EmailValidator emailValidator;
|
private final EmailValidator emailValidator;
|
||||||
|
|
||||||
|
|
|
@ -17,16 +17,15 @@
|
||||||
|
|
||||||
package haveno.core.payment.validation;
|
package haveno.core.payment.validation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.util.validation.NumberValidator;
|
import haveno.core.util.validation.NumberValidator;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
public class XmrValidator extends NumberValidator {
|
public class XmrValidator extends NumberValidator {
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.presentation;
|
package haveno.core.presentation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.xmr.Balances;
|
import haveno.core.xmr.Balances;
|
||||||
|
@ -25,8 +26,6 @@ import javafx.beans.property.StringProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BalancePresentation {
|
public class BalancePresentation {
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.presentation;
|
package haveno.core.presentation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.core.support.dispute.arbitration.ArbitrationManager;
|
import haveno.core.support.dispute.arbitration.ArbitrationManager;
|
||||||
import haveno.core.support.dispute.mediation.MediationManager;
|
import haveno.core.support.dispute.mediation.MediationManager;
|
||||||
import haveno.core.support.dispute.refund.RefundManager;
|
import haveno.core.support.dispute.refund.RefundManager;
|
||||||
|
@ -26,8 +27,6 @@ import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class SupportTicketsPresentation {
|
public class SupportTicketsPresentation {
|
||||||
@Getter
|
@Getter
|
||||||
private final StringProperty numOpenSupportTickets = new SimpleStringProperty();
|
private final StringProperty numOpenSupportTickets = new SimpleStringProperty();
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.presentation;
|
package haveno.core.presentation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.core.trade.TradeManager;
|
import haveno.core.trade.TradeManager;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
@ -25,8 +26,6 @@ import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
public class TradePresentation {
|
public class TradePresentation {
|
||||||
@Getter
|
@Getter
|
||||||
private final StringProperty numPendingTrades = new SimpleStringProperty();
|
private final StringProperty numPendingTrades = new SimpleStringProperty();
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.proto.network;
|
package haveno.core.proto.network;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.proto.ProtobufferException;
|
import haveno.common.proto.ProtobufferException;
|
||||||
import haveno.common.proto.ProtobufferRuntimeException;
|
import haveno.common.proto.ProtobufferRuntimeException;
|
||||||
import haveno.common.proto.network.NetworkEnvelope;
|
import haveno.common.proto.network.NetworkEnvelope;
|
||||||
|
@ -69,11 +71,8 @@ import haveno.network.p2p.storage.messages.RemoveMailboxDataMessage;
|
||||||
import haveno.network.p2p.storage.payload.MailboxStoragePayload;
|
import haveno.network.p2p.storage.payload.MailboxStoragePayload;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedMailboxStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedMailboxStorageEntry;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.time.Clock;
|
import java.time.Clock;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
// TODO Use ProtobufferException instead of ProtobufferRuntimeException
|
// TODO Use ProtobufferException instead of ProtobufferRuntimeException
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
|
|
||||||
package haveno.core.proto.persistable;
|
package haveno.core.proto.persistable;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.proto.ProtobufferRuntimeException;
|
import haveno.common.proto.ProtobufferRuntimeException;
|
||||||
import haveno.common.proto.network.NetworkProtoResolver;
|
import haveno.common.proto.network.NetworkProtoResolver;
|
||||||
import haveno.common.proto.persistable.NavigationPath;
|
import haveno.common.proto.persistable.NavigationPath;
|
||||||
|
@ -47,9 +49,6 @@ import haveno.network.p2p.storage.persistence.RemovedPayloadsMap;
|
||||||
import haveno.network.p2p.storage.persistence.SequenceNumberMap;
|
import haveno.network.p2p.storage.persistence.SequenceNumberMap;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
// TODO Use ProtobufferException instead of ProtobufferRuntimeException
|
// TODO Use ProtobufferException instead of ProtobufferRuntimeException
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.provider;
|
package haveno.core.provider;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.network.Socks5ProxyProvider;
|
import haveno.network.Socks5ProxyProvider;
|
||||||
import haveno.network.http.HttpClientImpl;
|
import haveno.network.http.HttpClientImpl;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class FeeHttpClient extends HttpClientImpl {
|
public class FeeHttpClient extends HttpClientImpl {
|
||||||
|
|
|
@ -17,14 +17,13 @@
|
||||||
|
|
||||||
package haveno.core.provider;
|
package haveno.core.provider;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.network.Socks5ProxyProvider;
|
import haveno.network.Socks5ProxyProvider;
|
||||||
import haveno.network.http.HttpClientImpl;
|
import haveno.network.http.HttpClientImpl;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MempoolHttpClient extends HttpClientImpl {
|
public class MempoolHttpClient extends HttpClientImpl {
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.provider;
|
package haveno.core.provider;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.network.Socks5ProxyProvider;
|
import haveno.network.Socks5ProxyProvider;
|
||||||
import haveno.network.http.HttpClientImpl;
|
import haveno.network.http.HttpClientImpl;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class PriceHttpClient extends HttpClientImpl {
|
public class PriceHttpClient extends HttpClientImpl {
|
||||||
|
|
|
@ -18,17 +18,15 @@
|
||||||
package haveno.core.provider;
|
package haveno.core.provider;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.name.Named;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProvidersRepository {
|
public class ProvidersRepository {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.google.common.util.concurrent.Futures;
|
||||||
import com.google.common.util.concurrent.MoreExecutors;
|
import com.google.common.util.concurrent.MoreExecutors;
|
||||||
import com.google.common.util.concurrent.SettableFuture;
|
import com.google.common.util.concurrent.SettableFuture;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
|
@ -29,16 +30,14 @@ import haveno.core.offer.OfferPayload;
|
||||||
import haveno.core.trade.Trade;
|
import haveno.core.trade.Trade;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.network.Socks5ProxyProvider;
|
import haveno.network.Socks5ProxyProvider;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.Coin;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.Coin;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.arbitration;
|
package haveno.core.support.dispute.arbitration;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.support.dispute.DisputeListService;
|
import haveno.core.support.dispute.DisputeListService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public final class ArbitrationDisputeListService extends DisputeListService<ArbitrationDisputeList> {
|
public final class ArbitrationDisputeListService extends DisputeListService<ArbitrationDisputeList> {
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,17 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.arbitration.arbitrator;
|
package haveno.core.support.dispute.arbitration.arbitrator;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.support.dispute.agent.DisputeAgentManager;
|
import haveno.core.support.dispute.agent.DisputeAgentManager;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.arbitration.arbitrator;
|
package haveno.core.support.dispute.arbitration.arbitrator;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.support.dispute.agent.DisputeAgentService;
|
import haveno.core.support.dispute.agent.DisputeAgentService;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.mediation;
|
package haveno.core.support.dispute.mediation;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.support.dispute.DisputeListService;
|
import haveno.core.support.dispute.DisputeListService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public final class MediationDisputeListService extends DisputeListService<MediationDisputeList> {
|
public final class MediationDisputeListService extends DisputeListService<MediationDisputeList> {
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,13 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.mediation.mediator;
|
package haveno.core.support.dispute.mediation.mediator;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.support.dispute.agent.DisputeAgentManager;
|
import haveno.core.support.dispute.agent.DisputeAgentManager;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,19 +17,18 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.mediation.mediator;
|
package haveno.core.support.dispute.mediation.mediator;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.support.dispute.agent.DisputeAgentService;
|
import haveno.core.support.dispute.agent.DisputeAgentService;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.refund;
|
package haveno.core.support.dispute.refund;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.support.dispute.DisputeListService;
|
import haveno.core.support.dispute.DisputeListService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public final class RefundDisputeListService extends DisputeListService<RefundDisputeList> {
|
public final class RefundDisputeListService extends DisputeListService<RefundDisputeList> {
|
||||||
|
|
||||||
|
|
|
@ -17,16 +17,15 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.refund.refundagent;
|
package haveno.core.support.dispute.refund.refundagent;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.support.dispute.agent.DisputeAgentManager;
|
import haveno.core.support.dispute.agent.DisputeAgentManager;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
|
|
||||||
package haveno.core.support.dispute.refund.refundagent;
|
package haveno.core.support.dispute.refund.refundagent;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.support.dispute.agent.DisputeAgentService;
|
import haveno.core.support.dispute.agent.DisputeAgentService;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package haveno.core.support.traderchat;
|
package haveno.core.support.traderchat;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.PubKeyRing;
|
import haveno.common.crypto.PubKeyRing;
|
||||||
import haveno.common.crypto.PubKeyRingProvider;
|
import haveno.common.crypto.PubKeyRingProvider;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.CoreMoneroConnectionsService;
|
||||||
|
@ -31,13 +33,10 @@ import haveno.core.trade.TradeManager;
|
||||||
import haveno.network.p2p.AckMessageSourceType;
|
import haveno.network.p2p.AckMessageSourceType;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import javafx.collections.ObservableList;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.trade;
|
package haveno.core.trade;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.crypto.PubKeyRing;
|
import haveno.common.crypto.PubKeyRing;
|
||||||
import haveno.common.proto.network.NetworkEnvelope;
|
import haveno.common.proto.network.NetworkEnvelope;
|
||||||
import haveno.core.trade.messages.TradeMessage;
|
import haveno.core.trade.messages.TradeMessage;
|
||||||
|
@ -27,10 +28,8 @@ import haveno.network.p2p.DecryptedMessageWithPubKey;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.mailbox.MailboxMessage;
|
import haveno.network.p2p.mailbox.MailboxMessage;
|
||||||
import haveno.network.p2p.mailbox.MailboxMessageService;
|
import haveno.network.p2p.mailbox.MailboxMessageService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
//TODO with the redesign of mailbox messages that is not required anymore. We leave it for now as we want to minimize
|
//TODO with the redesign of mailbox messages that is not required anymore. We leave it for now as we want to minimize
|
||||||
// changes for the 1.5.0 release but we should clean up afterwards...
|
// changes for the 1.5.0 release but we should clean up afterwards...
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.trade;
|
package haveno.core.trade;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.crypto.PubKeyRing;
|
import haveno.common.crypto.PubKeyRing;
|
||||||
import haveno.common.proto.network.NetworkEnvelope;
|
import haveno.common.proto.network.NetworkEnvelope;
|
||||||
import haveno.core.trade.messages.TradeMessage;
|
import haveno.core.trade.messages.TradeMessage;
|
||||||
|
@ -27,10 +28,8 @@ import haveno.network.p2p.DecryptedMessageWithPubKey;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.mailbox.MailboxMessage;
|
import haveno.network.p2p.mailbox.MailboxMessage;
|
||||||
import haveno.network.p2p.mailbox.MailboxMessageService;
|
import haveno.network.p2p.mailbox.MailboxMessageService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
//TODO with the redesign of mailbox messages that is not required anymore. We leave it for now as we want to minimize
|
//TODO with the redesign of mailbox messages that is not required anymore. We leave it for now as we want to minimize
|
||||||
// changes for the 1.5.0 release but we should clean up afterwards...
|
// changes for the 1.5.0 release but we should clean up afterwards...
|
||||||
|
|
|
@ -17,23 +17,14 @@
|
||||||
|
|
||||||
package haveno.core.trade;
|
package haveno.core.trade;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.monetary.CryptoMoney;
|
import haveno.core.monetary.CryptoMoney;
|
||||||
import haveno.core.monetary.TraditionalMoney;
|
import haveno.core.monetary.TraditionalMoney;
|
||||||
import haveno.core.monetary.Volume;
|
import haveno.core.monetary.Volume;
|
||||||
import haveno.core.offer.OpenOffer;
|
import haveno.core.offer.OpenOffer;
|
||||||
import haveno.core.util.FormattingUtils;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bitcoinj.core.Monetary;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static haveno.core.trade.ClosedTradableUtil.castToTrade;
|
import static haveno.core.trade.ClosedTradableUtil.castToTrade;
|
||||||
import static haveno.core.trade.ClosedTradableUtil.getTotalTxFee;
|
import static haveno.core.trade.ClosedTradableUtil.getTotalTxFee;
|
||||||
import static haveno.core.trade.ClosedTradableUtil.getTotalVolumeByCurrency;
|
import static haveno.core.trade.ClosedTradableUtil.getTotalVolumeByCurrency;
|
||||||
|
@ -42,10 +33,17 @@ import static haveno.core.trade.ClosedTradableUtil.isOpenOffer;
|
||||||
import static haveno.core.trade.Trade.DisputeState.DISPUTE_CLOSED;
|
import static haveno.core.trade.Trade.DisputeState.DISPUTE_CLOSED;
|
||||||
import static haveno.core.trade.Trade.DisputeState.MEDIATION_CLOSED;
|
import static haveno.core.trade.Trade.DisputeState.MEDIATION_CLOSED;
|
||||||
import static haveno.core.trade.Trade.DisputeState.REFUND_REQUEST_CLOSED;
|
import static haveno.core.trade.Trade.DisputeState.REFUND_REQUEST_CLOSED;
|
||||||
|
import haveno.core.util.FormattingUtils;
|
||||||
import static haveno.core.util.FormattingUtils.formatPercentagePrice;
|
import static haveno.core.util.FormattingUtils.formatPercentagePrice;
|
||||||
import static haveno.core.util.FormattingUtils.formatToPercentWithSymbol;
|
import static haveno.core.util.FormattingUtils.formatToPercentWithSymbol;
|
||||||
import static haveno.core.util.VolumeUtil.formatVolume;
|
import static haveno.core.util.VolumeUtil.formatVolume;
|
||||||
import static haveno.core.util.VolumeUtil.formatVolumeWithCode;
|
import static haveno.core.util.VolumeUtil.formatVolumeWithCode;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.bitcoinj.core.Monetary;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -17,8 +17,10 @@
|
||||||
|
|
||||||
package haveno.core.trade;
|
package haveno.core.trade;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.inject.Inject;
|
||||||
import common.utils.GenUtils;
|
import common.utils.GenUtils;
|
||||||
import haveno.common.ClockWatcher;
|
import haveno.common.ClockWatcher;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
|
@ -74,25 +76,6 @@ import haveno.network.p2p.DecryptedMessageWithPubKey;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.network.TorNetworkNode;
|
import haveno.network.p2p.network.TorNetworkNode;
|
||||||
import javafx.beans.property.BooleanProperty;
|
|
||||||
import javafx.beans.property.LongProperty;
|
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
|
||||||
import javafx.beans.property.SimpleLongProperty;
|
|
||||||
import javafx.collections.ListChangeListener;
|
|
||||||
import javafx.collections.ObservableList;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import monero.daemon.model.MoneroTx;
|
|
||||||
import monero.wallet.model.MoneroOutputQuery;
|
|
||||||
import org.bitcoinj.core.Coin;
|
|
||||||
import org.bouncycastle.crypto.params.KeyParameter;
|
|
||||||
import org.fxmisc.easybind.EasyBind;
|
|
||||||
import org.fxmisc.easybind.Subscription;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -106,9 +89,23 @@ import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import javafx.beans.property.LongProperty;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleLongProperty;
|
||||||
|
import javafx.collections.ListChangeListener;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import monero.daemon.model.MoneroTx;
|
||||||
|
import monero.wallet.model.MoneroOutputQuery;
|
||||||
|
import org.bitcoinj.core.Coin;
|
||||||
|
import org.bouncycastle.crypto.params.KeyParameter;
|
||||||
|
import org.fxmisc.easybind.EasyBind;
|
||||||
|
import org.fxmisc.easybind.Subscription;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
public class TradeManager implements PersistedDataHost, DecryptedDirectMessageListener {
|
public class TradeManager implements PersistedDataHost, DecryptedDirectMessageListener {
|
||||||
|
@ -410,7 +407,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||||
for (Trade trade : trades) {
|
for (Trade trade : trades) {
|
||||||
tasks.add(() -> {
|
tasks.add(() -> {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// check for duplicate uid
|
// check for duplicate uid
|
||||||
if (!uids.add(trade.getUid())) {
|
if (!uids.add(trade.getUid())) {
|
||||||
log.warn("Found trade with duplicate uid, skipping. That should never happen. {} {}, uid={}", trade.getClass().getSimpleName(), trade.getId(), trade.getUid());
|
log.warn("Found trade with duplicate uid, skipping. That should never happen. {} {}, uid={}", trade.getClass().getSimpleName(), trade.getId(), trade.getUid());
|
||||||
|
@ -442,10 +439,10 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||||
for (Trade trade : trades) {
|
for (Trade trade : trades) {
|
||||||
if (trade.isIdling()) HavenoUtils.submitTask(() -> trade.syncWallet());
|
if (trade.isIdling()) HavenoUtils.submitTask(() -> trade.syncWallet());
|
||||||
}
|
}
|
||||||
|
|
||||||
getObservableList().addListener((ListChangeListener<Trade>) change -> onTradesChanged());
|
getObservableList().addListener((ListChangeListener<Trade>) change -> onTradesChanged());
|
||||||
onTradesChanged();
|
onTradesChanged();
|
||||||
|
|
||||||
xmrWalletService.setTradeManager(this);
|
xmrWalletService.setTradeManager(this);
|
||||||
|
|
||||||
// process after all wallets initialized
|
// process after all wallets initialized
|
||||||
|
@ -473,7 +470,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||||
|
|
||||||
// notify that persisted trades initialized
|
// notify that persisted trades initialized
|
||||||
persistedTradesInitialized.set(true);
|
persistedTradesInitialized.set(true);
|
||||||
|
|
||||||
// We do not include failed trades as they should not be counted anyway in the trade statistics
|
// We do not include failed trades as they should not be counted anyway in the trade statistics
|
||||||
// TODO: remove stats?
|
// TODO: remove stats?
|
||||||
Set<Trade> nonFailedTrades = new HashSet<>(closedTradableManager.getClosedTrades());
|
Set<Trade> nonFailedTrades = new HashSet<>(closedTradableManager.getClosedTrades());
|
||||||
|
|
|
@ -17,24 +17,22 @@
|
||||||
|
|
||||||
package haveno.core.trade;
|
package haveno.core.trade;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.common.util.Tuple2;
|
import haveno.common.util.Tuple2;
|
||||||
import haveno.core.locale.Res;
|
|
||||||
import haveno.core.offer.Offer;
|
|
||||||
import haveno.core.xmr.wallet.BtcWalletService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
import static haveno.core.locale.CurrencyUtil.getCurrencyPair;
|
import static haveno.core.locale.CurrencyUtil.getCurrencyPair;
|
||||||
import static haveno.core.locale.CurrencyUtil.isTraditionalCurrency;
|
import static haveno.core.locale.CurrencyUtil.isTraditionalCurrency;
|
||||||
|
import haveno.core.locale.Res;
|
||||||
|
import haveno.core.offer.Offer;
|
||||||
import static haveno.core.util.FormattingUtils.formatDurationAsWords;
|
import static haveno.core.util.FormattingUtils.formatDurationAsWords;
|
||||||
|
import haveno.core.xmr.wallet.BtcWalletService;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains trade utility methods.
|
* This class contains trade utility methods.
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.trade.protocol;
|
package haveno.core.trade.protocol;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
|
@ -33,8 +34,6 @@ import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public class ProcessModelServiceProvider {
|
public class ProcessModelServiceProvider {
|
||||||
private final OpenOfferManager openOfferManager;
|
private final OpenOfferManager openOfferManager;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue