fix concurrent modification exception when trades added to main view
This commit is contained in:
parent
f9afd44345
commit
dd71423d95
@ -1157,11 +1157,13 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
}
|
||||
|
||||
public List<Trade> getAllTrades() {
|
||||
List<Trade> trades = new ArrayList<Trade>();
|
||||
trades.addAll(tradableList.getList());
|
||||
trades.addAll(closedTradableManager.getClosedTrades());
|
||||
trades.addAll(failedTradesManager.getObservableList());
|
||||
return trades;
|
||||
synchronized (tradableList) {
|
||||
List<Trade> trades = new ArrayList<Trade>();
|
||||
trades.addAll(tradableList.getList());
|
||||
trades.addAll(closedTradableManager.getClosedTrades());
|
||||
trades.addAll(failedTradesManager.getObservableList());
|
||||
return trades;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Trade> getOpenTrades() {
|
||||
|
@ -217,7 +217,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||
if (newValue) {
|
||||
tradeManager.applyTradePeriodState();
|
||||
|
||||
tradeManager.getObservableList().forEach(trade -> {
|
||||
tradeManager.getOpenTrades().forEach(trade -> {
|
||||
|
||||
// check initialization error
|
||||
if (trade.getInitError() != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user