mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 14:42:37 +01:00
Fix issues with wrong base currency
From the changes in isCryptoCurrency which return true in case of BTC there have been some bugs. We changed the check to distinguish between altcoin and fiat to check for BTC as base currency now. That area would require a bigger refactoring...
This commit is contained in:
parent
c2cb0e2965
commit
9f9349c835
4 changed files with 4 additions and 7 deletions
|
@ -17,8 +17,6 @@
|
|||
|
||||
package bisq.core.offer;
|
||||
|
||||
import bisq.core.locale.CurrencyUtil;
|
||||
|
||||
import bisq.network.p2p.NodeAddress;
|
||||
import bisq.network.p2p.storage.payload.ExpirablePayload;
|
||||
import bisq.network.p2p.storage.payload.ProtectedStoragePayload;
|
||||
|
@ -372,7 +370,7 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay
|
|||
// The rest of the app does not support yet that concept of base currency and counter currencies
|
||||
// so we map here for convenience
|
||||
public String getCurrencyCode() {
|
||||
return CurrencyUtil.isCryptoCurrency(getBaseCurrencyCode()) ? getBaseCurrencyCode() : getCounterCurrencyCode();
|
||||
return getBaseCurrencyCode().equals("BTC") ? getCounterCurrencyCode() : getBaseCurrencyCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -62,6 +62,7 @@ public class AssetTradeActivityCheck {
|
|||
|
||||
Map<String, Tuple2<Long, Integer>> tradeStatMap = new HashMap<>();
|
||||
tradeStatisticsManager.getObservableTradeStatisticsSet().stream()
|
||||
.filter(e -> !e.getBaseCurrency().equals("BTC"))
|
||||
.filter(e -> CurrencyUtil.isCryptoCurrency(e.getBaseCurrency()))
|
||||
.filter(e -> e.getTradeDate().getTime() > compareDate.getTime())
|
||||
.forEach(e -> {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package bisq.core.trade.statistics;
|
||||
|
||||
import bisq.core.locale.CurrencyUtil;
|
||||
import bisq.core.monetary.Altcoin;
|
||||
import bisq.core.monetary.AltcoinExchangeRate;
|
||||
import bisq.core.monetary.Price;
|
||||
|
@ -223,7 +222,7 @@ public final class TradeStatistics implements LazyProcessedPayload, ProtectedSto
|
|||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
return CurrencyUtil.isCryptoCurrency(baseCurrency) ? baseCurrency : counterCurrency;
|
||||
return baseCurrency.equals("BTC") ? counterCurrency : baseCurrency;
|
||||
}
|
||||
|
||||
public Coin getTradeAmount() {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package bisq.core.trade.statistics;
|
||||
|
||||
import bisq.core.locale.CurrencyUtil;
|
||||
import bisq.core.monetary.Altcoin;
|
||||
import bisq.core.monetary.AltcoinExchangeRate;
|
||||
import bisq.core.monetary.Price;
|
||||
|
@ -248,7 +247,7 @@ public final class TradeStatistics2 implements LazyProcessedPayload, Persistable
|
|||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
return CurrencyUtil.isCryptoCurrency(baseCurrency) ? baseCurrency : counterCurrency;
|
||||
return baseCurrency.equals("BTC") ? counterCurrency : baseCurrency;
|
||||
}
|
||||
|
||||
public Coin getTradeAmount() {
|
||||
|
|
Loading…
Add table
Reference in a new issue