<p></p>
<p><b>@ghubstan</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5666#discussion_r693115937">desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBook.java</a>:</p>
<pre style='color:#555'>> +        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))) {
</pre>
<p>There can be a null hash each time a user clicks on the view, and calling <code>OfferBook#fillOfferBookListItems()</code>.  That method loads the view using <code>offerBookService.getOffers()</code>, and the returned list elements are mapped to new <code>OfferBookListItem(offer)</code>s with a null hash code.</p>
<p>We discussed this on keybase, when you mentioned the idea of adding a <code>transient var hash</code> to OfferPayload.<br>
At that time, I also mentioned that without the cached OfferPayload hash,  OfferBook line 208 might be<br>
<code>.map(o -> new OfferBookListItem(o, get32ByteHashAsByteArray(o.getOfferPayload()))</code></p>
<p>There is a comment about null hashes in <code>OfferBookListItem</code>:  <em>A null value indicates the item's payload hash has not been set by onAdded or onRemoved since the most recent OfferBook view refresh.</em></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5666#discussion_r693115937">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNRX5STMRWQNAQM442TT52HXVANCNFSM5CIFYDRA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email">Android</a>.<img src="https://github.com/notifications/beacon/AJFFTNVELJOMZPJQFRSSQRDT52HXVA5CNFSM5CIFYDRKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFPJRIXI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5666#discussion_r693115937",
"url": "https://github.com/bisq-network/bisq/pull/5666#discussion_r693115937",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>