mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-03 09:29:44 +00:00
remove incomplete trades from trade summary to fix #1029
This commit is contained in:
parent
5108c22a29
commit
69a1e67da2
2 changed files with 9 additions and 1 deletions
|
@ -41,6 +41,14 @@ public class ClosedTradableUtil {
|
||||||
public static Map<String, Long> getTotalVolumeByCurrency(List<Tradable> tradableList) {
|
public static Map<String, Long> getTotalVolumeByCurrency(List<Tradable> tradableList) {
|
||||||
Map<String, Long> map = new HashMap<>();
|
Map<String, Long> map = new HashMap<>();
|
||||||
tradableList.stream()
|
tradableList.stream()
|
||||||
|
.filter(tradable -> {
|
||||||
|
if (tradable instanceof Trade) {
|
||||||
|
Trade trade = castToTrade(tradable);
|
||||||
|
return trade.isCompleted(); // TODO: does not consider if trade was reverted by arbitrator
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
.flatMap(tradable -> tradable.getOptionalVolume().stream())
|
.flatMap(tradable -> tradable.getOptionalVolume().stream())
|
||||||
.forEach(volume -> {
|
.forEach(volume -> {
|
||||||
String currencyCode = volume.getCurrencyCode();
|
String currencyCode = volume.getCurrencyCode();
|
||||||
|
|
|
@ -2180,7 +2180,7 @@ public abstract class Trade implements Tradable, Model {
|
||||||
return tradeAmountTransferred();
|
return tradeAmountTransferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean tradeAmountTransferred() {
|
public boolean tradeAmountTransferred() {
|
||||||
return isPaymentReceived() || (getDisputeResult() != null && getDisputeResult().getWinner() == DisputeResult.Winner.SELLER);
|
return isPaymentReceived() || (getDisputeResult() != null && getDisputeResult().getWinner() == DisputeResult.Winner.SELLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue