[bisq-network/bisq] Adjust API 'editoffer' to PR 5651 (include extraData field when editing offer) (#5666)

Stan notifications at github.com
Wed Aug 25 16:31:04 CEST 2021


@ghubstan commented on this pull request.



> +        if (!candidateWithMatchingPayloadHash.isPresent()) {
+            if (log.isDebugEnabled()) {
+                log.debug("UI view list does not contain offer with id {} and payload-hash {}",
+                        offer.getId(),
+                        hashOfPayload == null ? "null" : hashOfPayload.getHex());
+            }
+            return;
+        }
+
+        OfferBookListItem candidate = candidateWithMatchingPayloadHash.get();
+
+        // Remove the candidate only if the candidate's offer payload hash matches the
+        // onRemoved hashOfPayload parameter.  We may receive add/remove messages out of
+        // order (from api's 'editoffer'), and use the offer payload hash to
+        // ensure we do not remove an edited offer immediately after it was added.
+        if ((candidate.getHashOfPayload() == null || candidate.getHashOfPayload().equals(hashOfPayload))) {

It is a way to get around the hash check if the list contains an item loaded by `OfferBook#fillOfferBookListItems()` (where items are created with null hashes).

If we do create a transient OfferPayload hash field, fillOfferBookListItems() can load the view with non-null hashes, and this null hash check can be removed.

-- 
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/5666#discussion_r695812492
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210825/49527738/attachment.htm>


More information about the bisq-github mailing list