mirror of
https://github.com/retoaccess1/haveno-reto.git
synced 2024-12-11 20:33:32 +01:00
fix concurrent modification exception in spread view
This commit is contained in:
parent
8462ff1019
commit
113a94b1f9
@ -113,18 +113,20 @@ class SpreadViewModel extends ActivatableViewModel {
|
|||||||
|
|
||||||
private void update(ObservableList<OfferBookListItem> offerBookListItems) {
|
private void update(ObservableList<OfferBookListItem> offerBookListItems) {
|
||||||
Map<String, List<Offer>> offersByCurrencyMap = new HashMap<>();
|
Map<String, List<Offer>> offersByCurrencyMap = new HashMap<>();
|
||||||
for (OfferBookListItem offerBookListItem : offerBookListItems) {
|
synchronized (offerBookListItems) {
|
||||||
Offer offer = offerBookListItem.getOffer();
|
for (OfferBookListItem offerBookListItem : offerBookListItems) {
|
||||||
String key = offer.getCurrencyCode();
|
Offer offer = offerBookListItem.getOffer();
|
||||||
if (includePaymentMethod) {
|
String key = offer.getCurrencyCode();
|
||||||
key = offer.getPaymentMethod().getShortName();
|
if (includePaymentMethod) {
|
||||||
if (expandedView) {
|
key = offer.getPaymentMethod().getShortName();
|
||||||
key += ":" + offer.getCurrencyCode();
|
if (expandedView) {
|
||||||
|
key += ":" + offer.getCurrencyCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!offersByCurrencyMap.containsKey(key))
|
||||||
|
offersByCurrencyMap.put(key, new ArrayList<>());
|
||||||
|
offersByCurrencyMap.get(key).add(offer);
|
||||||
}
|
}
|
||||||
if (!offersByCurrencyMap.containsKey(key))
|
|
||||||
offersByCurrencyMap.put(key, new ArrayList<>());
|
|
||||||
offersByCurrencyMap.get(key).add(offer);
|
|
||||||
}
|
}
|
||||||
spreadItems.clear();
|
spreadItems.clear();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user