Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
90110ac514 | ||
|
8c098632b7 | ||
|
a35a7bf664 |
7 changed files with 23 additions and 12 deletions
|
@ -19,10 +19,8 @@ package haveno.core.locale;
|
||||||
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public final class CryptoCurrency extends TradeCurrency {
|
public final class CryptoCurrency extends TradeCurrency {
|
||||||
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
|
// http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618
|
||||||
private final static String PREFIX = "✦ ";
|
private final static String PREFIX = "✦ ";
|
||||||
|
|
|
@ -201,7 +201,6 @@ public class CurrencyUtil {
|
||||||
result.add(new CryptoCurrency("ETH", "Ether"));
|
result.add(new CryptoCurrency("ETH", "Ether"));
|
||||||
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
result.add(new CryptoCurrency("LTC", "Litecoin"));
|
||||||
result.add(new CryptoCurrency("USDT-ERC20", "Tether USD (ERC20)"));
|
result.add(new CryptoCurrency("USDT-ERC20", "Tether USD (ERC20)"));
|
||||||
result.add(new CryptoCurrency("USDT-TRC20", "Tether USD (TRC20)"));
|
|
||||||
result.sort(TradeCurrency::compareTo);
|
result.sort(TradeCurrency::compareTo);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,19 +19,16 @@ package haveno.core.locale;
|
||||||
|
|
||||||
import haveno.common.proto.ProtobufferRuntimeException;
|
import haveno.common.proto.ProtobufferRuntimeException;
|
||||||
import haveno.common.proto.persistable.PersistablePayload;
|
import haveno.common.proto.persistable.PersistablePayload;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@EqualsAndHashCode
|
|
||||||
@ToString
|
@ToString
|
||||||
@Getter
|
@Getter
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class TradeCurrency implements PersistablePayload, Comparable<TradeCurrency> {
|
public abstract class TradeCurrency implements PersistablePayload, Comparable<TradeCurrency> {
|
||||||
protected final String code;
|
protected final String code;
|
||||||
@EqualsAndHashCode.Exclude
|
|
||||||
protected final String name;
|
protected final String name;
|
||||||
|
|
||||||
public TradeCurrency(String code, String name) {
|
public TradeCurrency(String code, String name) {
|
||||||
|
@ -82,4 +79,23 @@ public abstract class TradeCurrency implements PersistablePayload, Comparable<Tr
|
||||||
return this.name.compareTo(other.name);
|
return this.name.compareTo(other.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj instanceof TradeCurrency) {
|
||||||
|
TradeCurrency other = (TradeCurrency) obj;
|
||||||
|
return code.equals(other.code);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return code.hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,14 +36,12 @@ package haveno.core.locale;
|
||||||
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import java.util.Currency;
|
import java.util.Currency;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString
|
@ToString
|
||||||
@Getter
|
@Getter
|
||||||
public final class TraditionalCurrency extends TradeCurrency {
|
public final class TraditionalCurrency extends TradeCurrency {
|
||||||
|
|
|
@ -200,7 +200,7 @@ public class Offer implements NetworkPayload, PersistablePayload {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("We don't have a market price. " +
|
log.trace("We don't have a market price. " +
|
||||||
"That case could only happen if you don't have a price feed.");
|
"That case could only happen if you don't have a price feed.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class ProvidersRepository {
|
||||||
fillProviderList();
|
fillProviderList();
|
||||||
|
|
||||||
// select next provider if current provider is null or banned
|
// select next provider if current provider is null or banned
|
||||||
if (baseUrl == null || isBanned(baseUrl)) selectNextProviderBaseUrl();
|
if (baseUrl.isEmpty() || isBanned(baseUrl)) selectNextProviderBaseUrl();
|
||||||
|
|
||||||
if (bannedNodes != null && !bannedNodes.isEmpty()) {
|
if (bannedNodes != null && !bannedNodes.isEmpty()) {
|
||||||
log.info("Excluded provider nodes from filter: nodes={}, selected provider baseUrl={}, providerList={}", bannedNodes, baseUrl, providerList);
|
log.info("Excluded provider nodes from filter: nodes={}, selected provider baseUrl={}, providerList={}", bannedNodes, baseUrl, providerList);
|
||||||
|
@ -140,7 +140,7 @@ public class ProvidersRepository {
|
||||||
"http://173.230.142.36:8078/");
|
"http://173.230.142.36:8078/");
|
||||||
} else {
|
} else {
|
||||||
providers = new ArrayList<String>();
|
providers = new ArrayList<String>();
|
||||||
providers.add(DEFAULT_LOCAL_NODE); // try local provider first
|
//providers.add(DEFAULT_LOCAL_NODE); // try local provider first
|
||||||
providers.addAll(DEFAULT_NODES);
|
providers.addAll(DEFAULT_NODES);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue