Removing star and unused imports with checkstyle

This commit is contained in:
napoly 2023-03-14 20:28:47 +01:00 committed by woodser
parent ce05710537
commit 3b8f19c4ce
1206 changed files with 5197 additions and 6620 deletions

View file

@ -28,16 +28,14 @@ import haveno.network.p2p.storage.payload.CapabilityRequiringPayload;
import haveno.network.p2p.storage.payload.DateTolerantPayload;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
import haveno.network.p2p.storage.payload.ProcessOncePersistableNetworkPayload;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Coin;
import java.time.Clock;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
// Supports signatures made from EC key (arbitrators) and signature created with DSA key.
@Slf4j
@Value

View file

@ -17,12 +17,6 @@
package haveno.core.account.sign;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;
import javax.inject.Inject;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Charsets;
import haveno.common.UserThread;
@ -40,13 +34,17 @@ import haveno.network.p2p.BootstrapListener;
import haveno.network.p2p.P2PService;
import haveno.network.p2p.storage.P2PDataStorage;
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.security.PublicKey;
import java.security.SignatureException;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -60,8 +58,6 @@ import java.util.Set;
import java.util.Stack;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class SignedWitnessService {
public static final long SIGNER_AGE_DAYS = 30;

View file

@ -22,15 +22,13 @@ import haveno.common.persistence.PersistenceManager;
import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
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.util.Map;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class SignedWitnessStorageService extends MapStoreService<SignedWitnessStore, PersistableNetworkPayload> {
private static final String FILE_NAME = "SignedWitnessStore";

View file

@ -20,11 +20,11 @@ package haveno.core.account.sign;
import com.google.protobuf.Message;
import haveno.network.p2p.storage.persistence.PersistableNetworkPayloadStore;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* We store only the payload in the PB file to save disc space. The hash of the payload can be created anyway and

View file

@ -23,14 +23,13 @@ import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.payload.DateTolerantPayload;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
import haveno.network.p2p.storage.payload.ProcessOncePersistableNetworkPayload;
import java.time.Clock;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import java.time.Clock;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
// Object has 28 raw bytes (33 bytes is size of ProtoBuffer object in storage list, 5 byte extra for list -> totalBytes = 5 + n*33)
// With 1 000 000 entries we get about 33 MB of data. Old entries will be shipped with the resource file,
// so only the newly added objects since the last release will be retrieved over the P2P network.

View file

@ -17,11 +17,6 @@
package haveno.core.account.witness;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;
import javax.inject.Inject;
import com.google.common.annotations.VisibleForTesting;
import haveno.common.UserThread;
import haveno.common.crypto.CryptoException;
@ -56,11 +51,15 @@ import haveno.network.p2p.BootstrapListener;
import haveno.network.p2p.P2PService;
import haveno.network.p2p.storage.P2PDataStorage;
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.security.PublicKey;
import java.time.Clock;
import java.util.Arrays;
import java.util.Date;
import java.util.GregorianCalendar;
@ -76,9 +75,6 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkNotNull;
@Slf4j
@ -254,13 +250,13 @@ public class AccountAgeWitnessService {
synchronized (this) {
AccountAgeWitness accountAgeWitness = getMyWitness(paymentAccountPayload);
P2PDataStorage.ByteArray hash = accountAgeWitness.getHashAsByteArray();
// We use first our fast lookup cache. If its in accountAgeWitnessCache it is also in accountAgeWitnessMap
// and we do not publish.
if (accountAgeWitnessCache.containsKey(hash)) {
return;
}
if (!accountAgeWitnessMap.containsKey(hash)) {
p2PService.addPersistableNetworkPayload(accountAgeWitness, false);
}

View file

@ -21,13 +21,12 @@ import haveno.common.config.Config;
import haveno.common.persistence.PersistenceManager;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
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 lombok.extern.slf4j.Slf4j;
@Slf4j
public class AccountAgeWitnessStorageService extends HistoricalDataStoreService<AccountAgeWitnessStore> {
private static final String FILE_NAME = "AccountAgeWitnessStore";

View file

@ -19,11 +19,11 @@ package haveno.core.account.witness;
import com.google.protobuf.Message;
import haveno.network.p2p.storage.persistence.PersistableNetworkPayloadStore;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* We store only the payload in the PB file to save disc space. The hash of the payload can be created anyway and

View file

@ -26,15 +26,14 @@ import haveno.core.account.sign.SignedWitnessService;
import haveno.core.payment.payload.PaymentAccountPayload;
import haveno.core.trade.Trade;
import haveno.network.p2p.storage.P2PDataStorage;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;
import java.util.Stack;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
@Slf4j

View file

@ -25,18 +25,16 @@ import haveno.common.util.ExtraDataMapValidator;
import haveno.core.user.Preferences;
import haveno.network.p2p.storage.payload.ExpirablePayload;
import haveno.network.p2p.storage.payload.ProtectedStoragePayload;
import java.security.PublicKey;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import java.security.PublicKey;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import static com.google.common.base.Preconditions.checkNotNull;

View file

@ -17,12 +17,6 @@
package haveno.core.alert;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;
import javax.inject.Inject;
import javax.inject.Named;
import com.google.common.base.Charsets;
import haveno.common.app.DevEnv;
import haveno.common.config.Config;
@ -35,16 +29,17 @@ import haveno.network.p2p.storage.payload.ProtectedStoragePayload;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import java.security.SignatureException;
import java.math.BigInteger;
import java.util.Collection;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;
import org.slf4j.Logger;
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 {

View file

@ -17,12 +17,6 @@
package haveno.core.alert;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;
import javax.inject.Inject;
import javax.inject.Named;
import com.google.common.base.Charsets;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
@ -46,21 +40,20 @@ import haveno.network.p2p.peers.keepalive.messages.Pong;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import java.security.SignatureException;
import java.math.BigInteger;
import java.util.Random;
import java.util.UUID;
import java.util.function.Consumer;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Utils;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Named;
import java.math.BigInteger;
import java.security.SignatureException;
import java.util.Random;
import java.util.UUID;
import java.util.function.Consumer;
import static org.bitcoinj.core.Utils.HEX;

View file

@ -21,11 +21,11 @@ import haveno.common.app.Version;
import haveno.common.proto.network.NetworkEnvelope;
import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.mailbox.MailboxMessage;
import java.util.concurrent.TimeUnit;
import lombok.EqualsAndHashCode;
import lombok.Value;
import java.util.concurrent.TimeUnit;
@EqualsAndHashCode(callSuper = true)
@Value
public class PrivateNotificationMessage extends NetworkEnvelope implements MailboxMessage {

View file

@ -21,12 +21,11 @@ import com.google.protobuf.ByteString;
import haveno.common.crypto.Sig;
import haveno.common.proto.network.NetworkPayload;
import haveno.common.util.Utilities;
import java.security.PublicKey;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import javax.annotation.Nullable;
import java.security.PublicKey;
import static com.google.common.base.Preconditions.checkNotNull;

View file

@ -17,8 +17,6 @@
package haveno.core.api;
import static com.google.common.base.Preconditions.checkState;
import haveno.common.config.Config;
import haveno.common.crypto.IncorrectPasswordException;
import haveno.common.crypto.KeyRing;
@ -26,6 +24,12 @@ import haveno.common.crypto.KeyStorage;
import haveno.common.file.FileUtil;
import haveno.common.persistence.PersistenceManager;
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.InputStream;
import java.io.PipedInputStream;
@ -33,13 +37,8 @@ import java.io.PipedOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.commons.lang3.StringUtils;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkState;
/**
* Manages the account state. A created account must have a password which encrypts

View file

@ -17,13 +17,6 @@
package haveno.core.api;
import haveno.proto.grpc.NotificationMessage;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.common.util.concurrent.FutureCallback;
import haveno.common.app.Version;
import haveno.common.config.Config;
@ -52,6 +45,16 @@ import haveno.core.trade.Trade;
import haveno.core.trade.statistics.TradeStatistics3;
import haveno.core.trade.statistics.TradeStatisticsManager;
import haveno.core.xmr.MoneroNodeSettings;
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.InputStream;
import java.math.BigInteger;
@ -62,14 +65,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
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;
/**
* Provides high level interface to functionality of core Haveno features.
* E.g. useful for different APIs to access data of different domains of Haveno.
@ -499,7 +494,7 @@ public class CoreApi {
public List<PaymentMethod> getCryptoCurrencyPaymentMethods() {
return paymentAccountsService.getCryptoCurrencyPaymentMethods();
}
public void validateFormField(PaymentAccountForm form, PaymentAccountFormField.FieldId fieldId, String value) {
paymentAccountsService.validateFormField(form, fieldId, value);
}

View file

@ -17,13 +17,13 @@
package haveno.core.api;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
@Slf4j
public class CoreContext {

View file

@ -32,6 +32,7 @@ import haveno.core.user.User;
import haveno.core.xmr.wallet.XmrWalletService;
import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.P2PService;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.ECKey;
import javax.inject.Inject;
@ -42,8 +43,6 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static haveno.core.support.SupportType.ARBITRATION;
import static haveno.core.support.SupportType.MEDIATION;
import static haveno.core.support.SupportType.REFUND;

View file

@ -23,21 +23,19 @@ import haveno.core.trade.TradeManager;
import haveno.core.util.FormattingUtils;
import haveno.core.util.coin.CoinFormatter;
import haveno.core.xmr.wallet.XmrWalletService;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.lang.String.format;
import java.math.BigInteger;
@Singleton
@Slf4j

View file

@ -17,16 +17,15 @@
package haveno.core.api;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import lombok.extern.slf4j.Slf4j;
import static java.io.File.separator;
import static java.lang.String.format;
import static java.lang.System.out;

View file

@ -7,12 +7,6 @@ import haveno.core.trade.HavenoUtils;
import haveno.core.xmr.model.EncryptedConnectionList;
import haveno.core.xmr.setup.DownloadListener;
import haveno.core.xmr.setup.WalletsSetup;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.LongProperty;
import javafx.beans.property.ObjectProperty;
@ -22,8 +16,6 @@ import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleLongProperty;
import javafx.beans.property.SimpleObjectProperty;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import monero.common.MoneroConnectionManager;
@ -35,6 +27,15 @@ import monero.daemon.MoneroDaemonRpc;
import monero.daemon.model.MoneroDaemonInfo;
import monero.daemon.model.MoneroPeer;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Singleton
public final class CoreMoneroConnectionsService {
@ -306,7 +307,7 @@ public final class CoreMoneroConnectionsService {
/**
* Signals that both the daemon and wallet have synced.
*
*
* TODO: separate daemon and wallet download/done listeners
*/
public void doneDownload() {

View file

@ -22,19 +22,17 @@ import haveno.common.util.Utilities;
import haveno.core.trade.HavenoUtils;
import haveno.core.user.Preferences;
import haveno.core.xmr.MoneroNodeSettings;
import lombok.extern.slf4j.Slf4j;
import monero.daemon.MoneroDaemonRpc;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import monero.daemon.MoneroDaemonRpc;
/**
* Start and stop or connect to a local Monero node.
*/

View file

@ -1,19 +1,18 @@
package haveno.core.api;
import haveno.proto.grpc.NotificationMessage;
import haveno.proto.grpc.NotificationMessage.NotificationType;
import haveno.core.api.model.TradeInfo;
import haveno.core.support.messages.ChatMessage;
import haveno.core.trade.Trade;
import javax.inject.Singleton;
import haveno.proto.grpc.NotificationMessage;
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.LinkedList;
import java.util.List;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
@Singleton
@Slf4j
public class CoreNotificationService {

View file

@ -26,19 +26,19 @@ import haveno.core.offer.Offer;
import haveno.core.offer.OfferBookService;
import haveno.core.offer.OfferDirection;
import haveno.core.offer.OfferFilterService;
import haveno.core.offer.OfferFilterService.Result;
import haveno.core.offer.OfferUtil;
import haveno.core.offer.OpenOffer;
import haveno.core.offer.OpenOfferManager;
import haveno.core.offer.OfferFilterService.Result;
import haveno.core.payment.PaymentAccount;
import haveno.core.user.User;
import haveno.core.util.PriceUtil;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Transaction;
import org.bitcoinj.utils.Fiat;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
@ -50,8 +50,6 @@ import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import static haveno.common.util.MathUtils.exactMultiply;
import static haveno.common.util.MathUtils.roundDoubleToLong;
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
@ -79,7 +77,7 @@ public class CoreOffersService {
private final OfferFilterService offerFilter;
private final OpenOfferManager openOfferManager;
private final User user;
@Inject
public CoreOffersService(CoreContext coreContext,
KeyRing keyRing,

View file

@ -32,19 +32,17 @@ import haveno.core.payment.PaymentAccount;
import haveno.core.payment.PaymentAccountFactory;
import haveno.core.payment.payload.PaymentMethod;
import haveno.core.user.User;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.io.File;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
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;

View file

@ -17,9 +17,6 @@
package haveno.core.api;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.common.math.LongMath;
import haveno.core.api.model.MarketDepthInfo;
import haveno.core.api.model.MarketPriceInfo;
@ -30,15 +27,17 @@ import haveno.core.offer.OfferBookService;
import haveno.core.offer.OfferDirection;
import haveno.core.provider.price.PriceFeedService;
import haveno.core.trade.HavenoUtils;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
@Singleton
@Slf4j
@ -140,7 +139,7 @@ class CorePriceService {
return new MarketDepthInfo(currencyCode, buyPrices, buyDepth, sellPrices, sellDepth);
}
/**
* PriceProvider returns different values for crypto and fiat,
* e.g. 1 XMR = X USD

View file

@ -35,22 +35,20 @@ import haveno.core.user.User;
import haveno.core.util.validation.BtcAddressValidator;
import haveno.core.xmr.model.AddressEntry;
import haveno.core.xmr.wallet.BtcWalletService;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Coin;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import lombok.extern.slf4j.Slf4j;
import static haveno.core.xmr.model.AddressEntry.Context.TRADE_PAYOUT;
import static java.lang.String.format;
import java.math.BigInteger;
@Singleton
@Slf4j
class CoreTradesService {

View file

@ -17,18 +17,6 @@
package haveno.core.api;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Transaction;
import org.bitcoinj.core.TransactionConfidence;
import org.bitcoinj.crypto.KeyCrypterScrypt;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
@ -51,28 +39,33 @@ import haveno.core.xmr.setup.WalletsSetup;
import haveno.core.xmr.wallet.BtcWalletService;
import haveno.core.xmr.wallet.WalletsManager;
import haveno.core.xmr.wallet.XmrWalletService;
import lombok.extern.slf4j.Slf4j;
import monero.wallet.model.MoneroDestination;
import monero.wallet.model.MoneroTxWallet;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Transaction;
import org.bitcoinj.core.TransactionConfidence;
import org.bitcoinj.crypto.KeyCrypterScrypt;
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.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
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;
import monero.wallet.model.MoneroDestination;
import monero.wallet.model.MoneroTxWallet;
@Singleton
@Slf4j
class CoreWalletsService {

View file

@ -20,10 +20,10 @@ package haveno.core.api.model;
import haveno.common.Payload;
import haveno.core.payment.payload.PaymentAccountPayload;
import haveno.core.proto.CoreProtoResolver;
import java.util.function.Supplier;
import lombok.Getter;
import java.util.function.Supplier;
/**
* A lightweight Trade Contract constructed from a trade's json contract.
* Many fields in the core Contract are ignored, but can be added as needed.

View file

@ -17,12 +17,11 @@
package haveno.core.api.model;
import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.ToString;
import java.util.Arrays;
@ToString
@AllArgsConstructor
public class MarketDepthInfo {

View file

@ -23,12 +23,13 @@ import haveno.core.api.model.builder.OfferInfoBuilder;
import haveno.core.monetary.Price;
import haveno.core.offer.Offer;
import haveno.core.offer.OpenOffer;
import java.util.Optional;
import javax.annotation.Nullable;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import javax.annotation.Nullable;
import java.util.Optional;
import static haveno.common.util.MathUtils.exactMultiply;
import static haveno.core.util.PriceUtil.reformatMarketPrice;
import static haveno.core.util.VolumeUtil.formatVolume;

View file

@ -17,11 +17,6 @@
package haveno.core.api.model;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.lang.String.format;
import static java.lang.System.getProperty;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.annotations.VisibleForTesting;
import com.google.gson.Gson;
import haveno.common.proto.ProtoUtil;
@ -30,6 +25,13 @@ import haveno.core.payment.PaymentAccount;
import haveno.core.payment.PaymentAccountFactory;
import haveno.core.payment.payload.PaymentMethod;
import haveno.core.trade.HavenoUtils;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.annotation.concurrent.Immutable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@ -43,12 +45,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.concurrent.Immutable;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.lang.String.format;
import static java.lang.System.getProperty;
import static java.nio.charset.StandardCharsets.UTF_8;
@Getter
@Immutable
@ -56,7 +57,7 @@ import org.apache.commons.lang3.StringUtils;
@ToString
@Slf4j
public final class PaymentAccountForm implements PersistablePayload {
public enum FormId {
BLOCK_CHAINS,
REVOLUT,
@ -80,10 +81,10 @@ public final class PaymentAccountForm implements PersistablePayload {
return protobuf.PaymentAccountForm.FormId.valueOf(formId.name());
}
}
private final FormId id;
private final List<PaymentAccountFormField> fields;
public PaymentAccountForm(FormId id) {
this.id = id;
this.fields = new ArrayList<PaymentAccountFormField>();

View file

@ -21,16 +21,17 @@ import haveno.common.proto.ProtoUtil;
import haveno.common.proto.persistable.PersistablePayload;
import haveno.core.locale.Country;
import haveno.core.locale.TradeCurrency;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Getter
@Setter

View file

@ -21,10 +21,11 @@ import haveno.common.Payload;
import haveno.core.api.model.builder.TradeInfoV1Builder;
import haveno.core.trade.Contract;
import haveno.core.trade.Trade;
import java.util.function.Function;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import java.util.function.Function;
import static haveno.core.api.model.OfferInfo.toOfferInfo;
import static haveno.core.util.PriceUtil.reformatMarketPrice;
import static haveno.core.util.VolumeUtil.formatVolume;

View file

@ -1,10 +1,11 @@
package haveno.core.api.model;
import haveno.common.Payload;
import java.math.BigInteger;
import lombok.Getter;
import monero.wallet.model.MoneroDestination;
import java.math.BigInteger;
@Getter
public class XmrDestination implements Payload {

View file

@ -1,13 +1,14 @@
package haveno.core.api.model;
import haveno.common.Payload;
import java.math.BigInteger;
import lombok.Getter;
import monero.wallet.model.MoneroIncomingTransfer;
import java.math.BigInteger;
@Getter
public class XmrIncomingTransfer implements Payload {
private final BigInteger amount;
private final Integer accountIndex;
private final Integer subaddressIndex;
@ -63,7 +64,7 @@ public class XmrIncomingTransfer implements Payload {
private Integer subaddressIndex;
private String address;
private Long numSuggestedConfirmations;
public XmrIncomingTransferBuilder withAmount(BigInteger amount) {
this.amount = amount;
return this;

View file

@ -1,16 +1,17 @@
package haveno.core.api.model;
import static haveno.core.api.model.XmrDestination.toXmrDestination;
import haveno.common.Payload;
import haveno.common.proto.ProtoUtil;
import lombok.Getter;
import monero.wallet.model.MoneroOutgoingTransfer;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import lombok.Getter;
import monero.wallet.model.MoneroOutgoingTransfer;
import static haveno.core.api.model.XmrDestination.toXmrDestination;
@Getter
public class XmrOutgoingTransfer implements Payload {

View file

@ -1,17 +1,18 @@
package haveno.core.api.model;
import static haveno.core.api.model.XmrIncomingTransfer.toXmrIncomingTransfer;
import static haveno.core.api.model.XmrOutgoingTransfer.toXmrOutgoingTransfer;
import haveno.common.Payload;
import haveno.common.proto.ProtoUtil;
import lombok.Getter;
import monero.wallet.model.MoneroTxWallet;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import lombok.Getter;
import monero.wallet.model.MoneroTxWallet;
import static haveno.core.api.model.XmrIncomingTransfer.toXmrIncomingTransfer;
import static haveno.core.api.model.XmrOutgoingTransfer.toXmrOutgoingTransfer;
@Getter
public class XmrTx implements Payload {

View file

@ -24,12 +24,13 @@ import haveno.network.p2p.P2PService;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import org.fxmisc.easybind.EasyBind;
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.
* To avoid those repeated checks for the state or setting of listeners on different domains we provide here a

View file

@ -22,14 +22,19 @@ import haveno.common.file.FileUtil;
import haveno.common.file.ResourceNotFoundException;
import haveno.common.util.Utilities;
import haveno.core.user.Preferences;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.nio.file.Paths;
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.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@ -39,17 +44,6 @@ import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import lombok.extern.slf4j.Slf4j;
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;
/**
* Prevents that Haveno gets hibernated from the OS. On OSX there is a tool called caffeinate but it seems it does not
* provide the behaviour we need, thus we use the trick to play a almost silent sound file in a loop. This keeps the

View file

@ -16,7 +16,12 @@
*/
package haveno.core.app;
import java.util.concurrent.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* A cancellable console input reader.

View file

@ -16,11 +16,13 @@
*/
package haveno.core.app;
import java.io.*;
import java.util.concurrent.Callable;
import lombok.extern.slf4j.Slf4j;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.concurrent.Callable;
@Slf4j
public class ConsoleInputReadTask implements Callable<String> {
public String call() throws IOException {

View file

@ -42,10 +42,16 @@ import haveno.network.p2p.P2PModule;
import haveno.network.p2p.network.BridgeAddressProvider;
import haveno.network.p2p.network.NetworkFilter;
import haveno.network.p2p.seed.SeedNodeRepository;
import java.io.File;
import static com.google.inject.name.Names.named;
import static haveno.common.config.Config.*;
import static haveno.common.config.Config.KEY_STORAGE_DIR;
import static haveno.common.config.Config.REFERRAL_ID;
import static haveno.common.config.Config.STORAGE_DIR;
import static haveno.common.config.Config.USE_DEV_MODE;
import static haveno.common.config.Config.USE_DEV_MODE_HEADER;
import static haveno.common.config.Config.USE_DEV_PRIVILEGE_KEYS;
public class CoreModule extends AppModule {

View file

@ -18,7 +18,6 @@
package haveno.core.app;
import haveno.common.ClockWatcher;
import haveno.common.app.DevEnv;
import haveno.common.persistence.PersistenceManager;
import haveno.core.account.sign.SignedWitnessService;
import haveno.core.account.witness.AccountAgeWitnessService;
@ -52,10 +51,8 @@ import haveno.core.trade.txproof.xmr.XmrTxProofService;
import haveno.core.user.User;
import haveno.core.xmr.Balances;
import haveno.network.p2p.P2PService;
import javax.inject.Inject;
import javafx.collections.ListChangeListener;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;

View file

@ -47,8 +47,10 @@ import haveno.core.xmr.setup.WalletsSetup;
import haveno.core.xmr.wallet.BtcWalletService;
import haveno.core.xmr.wallet.XmrWalletService;
import haveno.network.p2p.P2PService;
import java.io.Console;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import java.io.Console;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@ -56,10 +58,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
@Slf4j
public abstract class HavenoExecutable implements GracefulShutDownHandler, HavenoSetup.HavenoSetupListener, UncaughtExceptionHandler {

View file

@ -23,12 +23,12 @@ import haveno.common.app.Version;
import haveno.common.file.CorruptedStorageFileHandler;
import haveno.common.setup.GracefulShutDownHandler;
import haveno.core.trade.TradeManager;
import java.util.concurrent.TimeUnit;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.TimeUnit;
@Slf4j
public class HavenoHeadlessApp implements HeadlessApp {
@Getter

View file

@ -21,11 +21,11 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
import haveno.common.UserThread;
import haveno.common.app.AppModule;
import haveno.common.app.Version;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class HavenoHeadlessAppMain extends HavenoExecutable {
protected HeadlessApp headlessApp;

View file

@ -17,39 +17,6 @@
package haveno.core.app;
import org.bitcoinj.core.Coin;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.fxmisc.easybind.EasyBind;
import org.fxmisc.easybind.monadic.MonadicBinding;
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 java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Random;
import java.util.Scanner;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import ch.qos.logback.classic.Level;
import haveno.common.Timer;
import haveno.common.UserThread;
@ -97,11 +64,37 @@ import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.P2PService;
import haveno.network.p2p.storage.payload.PersistableNetworkPayload;
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.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Random;
import java.util.Scanner;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
@Slf4j
@Singleton

View file

@ -27,23 +27,19 @@ import haveno.network.p2p.P2PServiceListener;
import haveno.network.p2p.network.CloseConnectionReason;
import haveno.network.p2p.network.Connection;
import haveno.network.p2p.network.ConnectionListener;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.fxmisc.easybind.EasyBind;
import org.fxmisc.easybind.monadic.MonadicBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import java.util.function.Consumer;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.fxmisc.easybind.EasyBind;
import org.fxmisc.easybind.monadic.MonadicBinding;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.function.Consumer;
@Singleton
@Slf4j

View file

@ -17,23 +17,20 @@
package haveno.core.app;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.nio.file.Paths;
import static haveno.common.util.Preconditions.checkDir;
import haveno.common.config.Config;
import haveno.common.file.FileUtil;
import haveno.common.handlers.ErrorMessageHandler;
import java.io.File;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import static haveno.common.util.Preconditions.checkDir;
@Slf4j
@Singleton

View file

@ -30,17 +30,6 @@ import haveno.core.xmr.exceptions.InvalidHostException;
import haveno.core.xmr.exceptions.RejectedTxException;
import haveno.core.xmr.setup.WalletsSetup;
import haveno.core.xmr.wallet.WalletsManager;
import org.bitcoinj.core.RejectMessage;
import org.bitcoinj.core.VersionMessage;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.store.ChainFileLockedException;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.fxmisc.easybind.EasyBind;
import org.fxmisc.easybind.monadic.MonadicBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;
@ -49,14 +38,20 @@ import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.RejectMessage;
import org.bitcoinj.core.VersionMessage;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.store.ChainFileLockedException;
import org.fxmisc.easybind.EasyBind;
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
@Singleton

View file

@ -19,10 +19,10 @@ package haveno.core.app.misc;
import haveno.common.app.Version;
import haveno.common.config.Config;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
@Slf4j
public abstract class AppSetup {
protected final Config config;

View file

@ -31,15 +31,13 @@ import haveno.network.p2p.network.Connection;
import haveno.network.p2p.network.ConnectionListener;
import haveno.network.p2p.peers.PeerManager;
import haveno.network.p2p.storage.P2PDataStorage;
import javax.inject.Inject;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import java.util.ArrayList;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import java.util.ArrayList;
@Slf4j
public class AppSetupWithP2P extends AppSetup {
protected final P2PService p2PService;

View file

@ -25,10 +25,10 @@ import haveno.core.trade.statistics.TradeStatisticsManager;
import haveno.network.p2p.P2PService;
import haveno.network.p2p.peers.PeerManager;
import haveno.network.p2p.storage.P2PDataStorage;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
@Slf4j
public class AppSetupWithP2PAndDAO extends AppSetupWithP2P {

View file

@ -35,10 +35,11 @@ import haveno.core.xmr.wallet.XmrWalletService;
import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.P2PService;
import haveno.network.p2p.seed.SeedNodeRepository;
import lombok.extern.slf4j.Slf4j;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@ -46,8 +47,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class ExecutableForAppWithP2p extends HavenoExecutable {
private static final long CHECK_MEMORY_PERIOD_SEC = 300;

View file

@ -43,10 +43,17 @@ import haveno.network.p2p.P2PModule;
import haveno.network.p2p.network.BridgeAddressProvider;
import haveno.network.p2p.network.NetworkFilter;
import haveno.network.p2p.seed.SeedNodeRepository;
import java.io.File;
import static com.google.inject.name.Names.named;
import static haveno.common.config.Config.*;
import static haveno.common.config.Config.KEY_STORAGE_DIR;
import static haveno.common.config.Config.PREVENT_PERIODIC_SHUTDOWN_AT_SEED_NODE;
import static haveno.common.config.Config.REFERRAL_ID;
import static haveno.common.config.Config.STORAGE_DIR;
import static haveno.common.config.Config.USE_DEV_MODE;
import static haveno.common.config.Config.USE_DEV_MODE_HEADER;
import static haveno.common.config.Config.USE_DEV_PRIVILEGE_KEYS;
public class ModuleForAppWithP2p extends AppModule {

View file

@ -17,6 +17,7 @@
package haveno.core.filter;
import com.google.common.annotations.VisibleForTesting;
import com.google.protobuf.ByteString;
import haveno.common.crypto.Sig;
import haveno.common.proto.ProtoUtil;
@ -25,10 +26,11 @@ import haveno.common.util.ExtraDataMapValidator;
import haveno.common.util.Utilities;
import haveno.network.p2p.storage.payload.ExpirablePayload;
import haveno.network.p2p.storage.payload.ProtectedStoragePayload;
import com.google.common.annotations.VisibleForTesting;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import java.security.PublicKey;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@ -36,11 +38,6 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
@Slf4j
@Value
public final class Filter implements ProtectedStoragePayload, ExpirablePayload {

View file

@ -35,23 +35,20 @@ import haveno.network.p2p.P2PServiceListener;
import haveno.network.p2p.network.NetworkFilter;
import haveno.network.p2p.storage.HashMapChangedListener;
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Sha256Hash;
import javax.inject.Inject;
import javax.inject.Named;
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 java.security.PublicKey;
import java.nio.charset.StandardCharsets;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Named;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.PublicKey;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
@ -61,12 +58,6 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Consumer;
import java.lang.reflect.Method;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.bitcoinj.core.Utils.HEX;

View file

@ -17,12 +17,13 @@
package haveno.core.locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BankUtil {

View file

@ -19,6 +19,7 @@ package haveno.core.locale;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Arrays;
@ -32,8 +33,6 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class CountryUtil {

View file

@ -19,7 +19,6 @@ package haveno.core.locale;
import com.google.protobuf.Message;
import lombok.EqualsAndHashCode;
import lombok.Getter;

View file

@ -25,6 +25,8 @@ import haveno.asset.Token;
import haveno.common.config.BaseCurrencyNetwork;
import haveno.common.config.Config;
import haveno.core.filter.FilterManager;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -42,8 +44,6 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.extern.slf4j.Slf4j;
import static java.lang.String.format;
@Slf4j

View file

@ -19,14 +19,13 @@ package haveno.core.locale;
import com.google.protobuf.Message;
import java.util.Currency;
import java.util.Locale;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import java.util.Currency;
import java.util.Locale;
@EqualsAndHashCode(callSuper = true)
@ToString
@Getter

View file

@ -20,11 +20,10 @@ package haveno.core.locale;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import lombok.extern.slf4j.Slf4j;
import java.util.Locale;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class GlobalSettings {
private static boolean useAnimations = true;

View file

@ -17,6 +17,8 @@
package haveno.core.locale;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -24,8 +26,6 @@ import java.util.Locale;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class LanguageUtil {
private static final List<String> userLanguageCodes = Arrays.asList(

View file

@ -17,17 +17,20 @@
package haveno.core.locale;
import haveno.common.UserThread;
import haveno.common.app.DevEnv;
import haveno.common.config.BaseCurrencyNetwork;
import haveno.common.config.Config;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.text.MessageFormat;
import java.net.URL;
import java.net.URLConnection;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@ -35,18 +38,9 @@ import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import static haveno.common.util.Utilities.toListOfWrappedStrings;
import static java.nio.charset.StandardCharsets.UTF_8;
import haveno.common.UserThread;
import haveno.common.app.DevEnv;
import haveno.common.config.BaseCurrencyNetwork;
import haveno.common.config.Config;
@Slf4j
public class Res {
public static void setup() {

View file

@ -23,7 +23,6 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
@EqualsAndHashCode

View file

@ -17,15 +17,14 @@
package haveno.core.monetary;
import org.bitcoinj.core.Monetary;
import org.bitcoinj.utils.MonetaryFormat;
import com.google.common.math.LongMath;
import haveno.core.util.ParsingUtils;
import java.math.BigDecimal;
import org.bitcoinj.core.Monetary;
import org.bitcoinj.utils.MonetaryFormat;
import org.jetbrains.annotations.NotNull;
import java.math.BigDecimal;
import static com.google.common.base.Preconditions.checkArgument;
/**

View file

@ -17,12 +17,11 @@
package haveno.core.monetary;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.core.Coin;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkArgument;
// Cloned from ExchangeRate. Use Altcoin instead of Fiat.

View file

@ -19,7 +19,6 @@ package haveno.core.monetary;
import org.bitcoinj.core.Monetary;
import org.bitcoinj.utils.MonetaryFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View file

@ -20,17 +20,15 @@ package haveno.core.monetary;
import haveno.core.locale.CurrencyUtil;
import haveno.core.trade.HavenoUtils;
import haveno.core.util.ParsingUtils;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.bitcoinj.core.Monetary;
import org.bitcoinj.utils.ExchangeRate;
import org.bitcoinj.utils.Fiat;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jetbrains.annotations.NotNull;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* Monero price value with variable precision.

View file

@ -21,12 +21,10 @@ import haveno.core.locale.CurrencyUtil;
import haveno.core.util.ParsingUtils;
import org.bitcoinj.core.Monetary;
import org.bitcoinj.utils.Fiat;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jetbrains.annotations.NotNull;
public class Volume extends MonetaryWrapper implements Comparable<Volume> {
private static final Logger log = LoggerFactory.getLogger(Volume.class);

View file

@ -20,16 +20,15 @@ package haveno.core.network;
import haveno.common.config.Config;
import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.network.NetworkFilter;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class CoreNetworkFilter implements NetworkFilter {
private final Set<NodeAddress> bannedPeersFromOptions = new HashSet<>();

View file

@ -17,9 +17,6 @@
package haveno.core.network.p2p.inventory;
import javax.inject.Inject;
import javax.inject.Named;
import com.google.common.base.Enums;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
@ -27,7 +24,6 @@ import haveno.common.app.Version;
import haveno.common.config.Config;
import haveno.common.proto.network.NetworkEnvelope;
import haveno.common.util.Profiler;
import haveno.common.util.Utilities;
import haveno.core.filter.Filter;
import haveno.core.filter.FilterManager;
import haveno.core.network.p2p.inventory.messages.GetInventoryRequest;
@ -41,14 +37,14 @@ import haveno.network.p2p.network.Statistic;
import haveno.network.p2p.peers.PeerManager;
import haveno.network.p2p.storage.P2PDataStorage;
import haveno.network.p2p.storage.payload.ProtectedStorageEntry;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.lang.management.ManagementFactory;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Named;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class GetInventoryRequestHandler implements MessageListener {
private final NetworkNode networkNode;

View file

@ -21,14 +21,13 @@ import haveno.common.handlers.ErrorMessageHandler;
import haveno.core.network.p2p.inventory.model.InventoryItem;
import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.network.NetworkNode;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class GetInventoryRequestManager {
private final NetworkNode networkNode;

View file

@ -31,11 +31,11 @@ import haveno.network.p2p.network.Connection;
import haveno.network.p2p.network.ConnectionListener;
import haveno.network.p2p.network.MessageListener;
import haveno.network.p2p.network.NetworkNode;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import java.util.function.Consumer;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class GetInventoryRequester implements MessageListener, ConnectionListener {
private final static int TIMEOUT_SEC = 180;

View file

@ -22,13 +22,13 @@ import com.google.common.base.Optional;
import haveno.common.app.Version;
import haveno.common.proto.network.NetworkEnvelope;
import haveno.core.network.p2p.inventory.model.InventoryItem;
import java.util.HashMap;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import java.util.HashMap;
import java.util.Map;
@Getter
@EqualsAndHashCode(callSuper = false)
@ToString

View file

@ -18,6 +18,8 @@
package haveno.core.network.p2p.inventory.model;
import haveno.common.util.Tuple2;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -27,8 +29,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.jetbrains.annotations.Nullable;
public class DeviationByIntegerDiff implements DeviationType {
private final int warnTrigger;
private final int alertTrigger;

View file

@ -18,6 +18,8 @@
package haveno.core.network.p2p.inventory.model;
import haveno.common.util.Tuple2;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -27,8 +29,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.jetbrains.annotations.Nullable;
public class DeviationOfHashes implements DeviationType {
public DeviationSeverity getDeviationSeverity(Collection<List<RequestInfo>> collection,
@Nullable String value,

View file

@ -18,15 +18,14 @@
package haveno.core.network.p2p.inventory.model;
import haveno.common.util.Tuple2;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public enum InventoryItem {
// Percentage deviation
OfferPayload("OfferPayload",

View file

@ -17,15 +17,14 @@
package haveno.core.network.p2p.inventory.model;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
import lombok.Value;
import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
import java.util.Map;
@Getter
public class RequestInfo {
// Carries latest commit hash of feature changes (not latest commit as that is then the commit for editing that field)

View file

@ -20,13 +20,13 @@ package haveno.core.network.p2p.seed;
import haveno.common.config.Config;
import haveno.network.p2p.NodeAddress;
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.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@ -36,8 +36,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
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!
@Slf4j
@Singleton

View file

@ -18,10 +18,10 @@
package haveno.core.notifications;
import haveno.common.util.JsonExclude;
import java.util.Date;
import lombok.Value;
import java.util.Date;
@Value
public class MobileMessage {
private long sentDate;

View file

@ -17,22 +17,18 @@
package haveno.core.notifications;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.common.base.Charsets;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.security.NoSuchAlgorithmException;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Singleton
public class MobileMessageEncryption {

View file

@ -17,18 +17,15 @@
package haveno.core.notifications;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.common.annotations.VisibleForTesting;
import java.util.Arrays;
import lombok.Data;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.Arrays;
@Data
@Slf4j

View file

@ -17,8 +17,12 @@
package haveno.core.notifications;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.gson.Gson;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import haveno.common.UserThread;
@ -27,27 +31,17 @@ import haveno.common.config.Config;
import haveno.common.util.Utilities;
import haveno.core.user.Preferences;
import haveno.network.http.HttpClient;
import javax.inject.Named;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import org.apache.commons.codec.binary.Hex;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import java.util.UUID;
import java.util.function.Consumer;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Hex;
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;

View file

@ -17,11 +17,11 @@
package haveno.core.notifications;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Singleton
public class MobileNotificationValidator {

View file

@ -27,16 +27,14 @@ import haveno.core.support.dispute.mediation.MediationManager;
import haveno.core.support.dispute.refund.RefundManager;
import haveno.core.support.messages.ChatMessage;
import haveno.network.p2p.P2PService;
import javax.inject.Inject;
import javax.inject.Singleton;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.UUID;
@Slf4j
@Singleton
public class DisputeMsgEvents {

View file

@ -17,20 +17,19 @@
package haveno.core.notifications.alerts;
import javax.inject.Inject;
import javax.inject.Singleton;
import javafx.collections.ListChangeListener;
import haveno.core.locale.Res;
import haveno.core.notifications.MobileMessage;
import haveno.core.notifications.MobileMessageType;
import haveno.core.notifications.MobileNotificationService;
import haveno.core.offer.OpenOffer;
import haveno.core.offer.OpenOfferManager;
import java.util.UUID;
import javafx.collections.ListChangeListener;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.UUID;
@Slf4j
@Singleton
public class MyOfferTakenEvents {

View file

@ -24,17 +24,15 @@ import haveno.core.notifications.MobileMessageType;
import haveno.core.notifications.MobileNotificationService;
import haveno.core.trade.Trade;
import haveno.core.trade.TradeManager;
import javafx.collections.ListChangeListener;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import javafx.collections.ListChangeListener;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Singleton
public class TradeEvents {

View file

@ -20,12 +20,12 @@ package haveno.core.notifications.alerts.market;
import haveno.common.proto.persistable.PersistablePayload;
import haveno.core.payment.PaymentAccount;
import haveno.core.proto.CoreProtoResolver;
import java.util.ArrayList;
import java.util.List;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Value
public class MarketAlertFilter implements PersistablePayload {

View file

@ -29,21 +29,18 @@ import haveno.core.notifications.MobileNotificationService;
import haveno.core.offer.Offer;
import haveno.core.offer.OfferBookService;
import haveno.core.offer.OfferDirection;
import haveno.core.offer.OfferPayload;
import haveno.core.provider.price.MarketPrice;
import haveno.core.provider.price.PriceFeedService;
import haveno.core.user.User;
import haveno.core.util.FormattingUtils;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.utils.Fiat;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.List;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Singleton
public class MarketAlerts {

View file

@ -28,13 +28,12 @@ import haveno.core.provider.price.MarketPrice;
import haveno.core.provider.price.PriceFeedService;
import haveno.core.user.User;
import haveno.core.util.FormattingUtils;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.utils.Fiat;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Singleton
public class PriceAlert {

View file

@ -17,8 +17,6 @@
package haveno.core.offer;
import static haveno.core.payment.payload.PaymentMethod.HAL_CASH_ID;
import haveno.common.app.Version;
import haveno.common.crypto.PubKeyRingProvider;
import haveno.common.util.Utilities;
@ -39,17 +37,17 @@ import haveno.core.xmr.wallet.Restrictions;
import haveno.core.xmr.wallet.XmrWalletService;
import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.P2PService;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import static haveno.core.payment.payload.PaymentMethod.HAL_CASH_ID;
@Slf4j
@Singleton

View file

@ -38,28 +38,24 @@ import haveno.core.provider.price.MarketPrice;
import haveno.core.provider.price.PriceFeedService;
import haveno.core.util.VolumeUtil;
import haveno.network.p2p.NodeAddress;
import org.bitcoinj.utils.Fiat;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyStringProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.bitcoinj.utils.Fiat;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.security.PublicKey;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

View file

@ -37,11 +37,13 @@ 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.util.Collection;
import java.util.LinkedList;
import java.util.List;
@ -49,11 +51,6 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
/**
* Handles storage and retrieval of offers.
* Uses an invalidation flag to only request the full offer map in case there was a change (anyone has added or removed an offer).

View file

@ -26,20 +26,17 @@ import haveno.core.support.dispute.arbitration.arbitrator.Arbitrator;
import haveno.core.trade.HavenoUtils;
import haveno.core.user.Preferences;
import haveno.core.user.User;
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 javafx.collections.SetChangeListener;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Singleton
public class OfferFilterService {

View file

@ -17,8 +17,6 @@
package haveno.core.offer;
import org.bitcoinj.utils.MonetaryFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import haveno.common.util.MathUtils;
import haveno.core.locale.CurrencyUtil;
@ -27,13 +25,13 @@ import haveno.core.monetary.Price;
import haveno.core.monetary.Volume;
import haveno.core.payment.payload.PaymentMethod;
import haveno.core.trade.HavenoUtils;
import java.math.BigInteger;
import java.util.Date;
import org.bitcoinj.utils.MonetaryFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.Date;
public class OfferForJson {
private static final Logger log = LoggerFactory.getLogger(OfferForJson.class);

View file

@ -21,7 +21,6 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.protobuf.ByteString;
import haveno.common.crypto.Hash;
import haveno.common.crypto.PubKeyRing;
import haveno.common.proto.ProtoUtil;
@ -33,19 +32,19 @@ import haveno.network.p2p.NodeAddress;
import haveno.network.p2p.storage.payload.ExpirablePayload;
import haveno.network.p2p.storage.payload.ProtectedStoragePayload;
import haveno.network.p2p.storage.payload.RequiresOwnerIsOnlinePayload;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.lang.reflect.Type;
import java.security.PublicKey;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import java.lang.reflect.Type;
import java.security.PublicKey;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
// OfferPayload has about 1.4 kb. We should look into options to make it smaller but will be hard to do it in a
// backward compatible way. Maybe a candidate when segwit activation is done as hardfork?
@ -77,7 +76,7 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay
protected transient byte[] hash;
@Nullable
protected final Map<String, String> extraDataMap;
// address and signature of signing arbitrator
@Setter
@Nullable
@ -88,7 +87,7 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay
@Setter
@Nullable
protected List<String> reserveTxKeyImages;
// Keys for extra map
// Only set for fiat offers
public static final String ACCOUNT_AGE_WITNESS_HASH = "accountAgeWitnessHash";

View file

@ -22,6 +22,7 @@ import haveno.common.app.Capability;
import haveno.common.config.Config;
import haveno.common.util.Utilities;
import haveno.core.trade.HavenoUtils;
import java.math.BigInteger;
import java.util.Date;
import java.util.GregorianCalendar;

Some files were not shown because too many files have changed in this diff Show more