[bisq-network/bisq] (3/4) [REFACTOR] P2PDataStore::add/remove/refresh (#3557)

Julian Knutsen notifications at github.com
Wed Nov 6 00:40:10 UTC 2019


julianknutsen commented on this pull request.



>  
         boolean containsKey = map.containsKey(hashOfPayload);
-        if (containsKey) {
-            result = result && checkIfStoredDataPubKeyMatchesNewDataPubKey(protectedStorageEntry.getOwnerPubKey(), hashOfPayload);
+
+        // In a hash collision between two well formed ProtectedStorageEntry, the first item wins and will not be overwritten
+        if (containsKey &&

Do you have much context on when this condition is expected?

My understanding of the check is to verify that the NewEntry.ownerPubkKey == StoredEntry.ownerPubKey, but how could this fail unless there were identical SeqNr & Payload hashes from different owners? Maybe a misbehaving node sets the value wrong?

I may be missing something really straight forward, but I am happy to update the comment to be more appropriate for the check and not focus on hash collisions.

-- 
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/3557#discussion_r342868576
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191105/8d409c3a/attachment.html>


More information about the bisq-github mailing list