mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-03 09:29:44 +00:00
fix concurrent modification exception in spread view
This commit is contained in:
parent
8462ff1019
commit
113a94b1f9
1 changed files with 12 additions and 10 deletions
|
@ -113,6 +113,7 @@ class SpreadViewModel extends ActivatableViewModel {
|
|||
|
||||
private void update(ObservableList<OfferBookListItem> offerBookListItems) {
|
||||
Map<String, List<Offer>> offersByCurrencyMap = new HashMap<>();
|
||||
synchronized (offerBookListItems) {
|
||||
for (OfferBookListItem offerBookListItem : offerBookListItems) {
|
||||
Offer offer = offerBookListItem.getOffer();
|
||||
String key = offer.getCurrencyCode();
|
||||
|
@ -126,6 +127,7 @@ class SpreadViewModel extends ActivatableViewModel {
|
|||
offersByCurrencyMap.put(key, new ArrayList<>());
|
||||
offersByCurrencyMap.get(key).add(offer);
|
||||
}
|
||||
}
|
||||
spreadItems.clear();
|
||||
|
||||
BigInteger totalAmount = BigInteger.ZERO;
|
||||
|
|
Loading…
Reference in a new issue