mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 10:22:18 +01:00
Fix concurr. issues
This commit is contained in:
parent
49815176bb
commit
3a61409b5c
@ -61,6 +61,8 @@ import org.spongycastle.crypto.params.KeyParameter;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ -173,17 +175,25 @@ public class TradeManager {
|
||||
private void initPendingTrades() {
|
||||
Log.traceCall();
|
||||
|
||||
List<Trade> toAdd = new ArrayList<>();
|
||||
List<Trade> toRemove = new ArrayList<>();
|
||||
for (Trade trade : trades) {
|
||||
trade.setStorage(tradableListStorage);
|
||||
if (trade.isDepositFeePaid()) {
|
||||
initTrade(trade, trade.getProcessModel().getUseSavingsWallet(), trade.getProcessModel().getFundsNeededForTrade());
|
||||
trade.updateDepositTxFromWallet();
|
||||
} else if (trade.isTakerFeePaid()) {
|
||||
addTradeToFailedTrades(trade);
|
||||
toAdd.add(trade);
|
||||
} else {
|
||||
removePreparedTrade(trade);
|
||||
toRemove.add(trade);
|
||||
}
|
||||
}
|
||||
for (Trade trade : toAdd) {
|
||||
addTradeToFailedTrades(trade);
|
||||
}
|
||||
for (Trade trade : toRemove) {
|
||||
removePreparedTrade(trade);
|
||||
}
|
||||
pendingTradesInitialized.set(true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user