[bisq-network/bisq] Add UI OfferBook list add/remove checks (#5659)

Stan notifications at github.com
Mon Aug 16 19:25:53 CEST 2021


@ghubstan commented on this pull request.



>                  if (!hasSameOffer) {
-                    OfferBookListItem offerBookListItem = new OfferBookListItem(offer);
-                    // We don't use the contains method as the equals method in Offer takes state and errorMessage into account.
-                    // If we have an offer with same ID we remove it and add the new offer as it might have a changed state.
-                    Optional<OfferBookListItem> candidateWithSameId = offerBookListItems.stream()
-                            .filter(item -> item.getOffer().getId().equals(offer.getId()))
-                            .findAny();
-                    if (candidateWithSameId.isPresent()) {
-                        log.warn("We had an old offer in the list with the same Offer ID. We remove the old one. " +
-                                "old offerBookListItem={}, new offerBookListItem={}", candidateWithSameId.get(), offerBookListItem);
-                        offerBookListItems.remove(candidateWithSameId.get());
+                    OfferBookListItem newOfferBookListItem = new OfferBookListItem(offer, hashOfPayload, sequenceNumber);
+                    removeAnyOldOfferBookListItemsBeforeAddingReplacement(newOfferBookListItem);

Requested change in commit 59c031327725bfc669414389056b875eff9a9faa.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5659#discussion_r689723564
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210816/c2e8cf78/attachment.htm>


More information about the bisq-github mailing list