Add List<Trade> getTrades() to TradeManager (w/out transitive jfx dep)

This commit is contained in:
ghubstan 2022-01-16 16:41:09 -03:00
parent b4fa52f4e4
commit 50bbbfe6c4
No known key found for this signature in database
GPG Key ID: E35592D6800A861E

View File

@ -108,6 +108,7 @@ import org.bouncycastle.crypto.params.KeyParameter;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
@ -870,6 +871,12 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
.map(tradeModel -> (Trade) tradeModel);
}
public List<Trade> getTrades() {
return getObservableList().stream()
.filter(t -> !t.hasFailed())
.collect(Collectors.toList());
}
private void removeTrade(Trade trade) {
if (tradableList.remove(trade)) {
requestPersistence();