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

<p>you are correct, this will trigger some discussion. On the one hand, I really like how this clears up the code base, makes everything testable and more readable as well. On the other hand, you rely on an object to report on its own validity. From my side, I like the testing motivation so that is OK with me. We can always revisit this topic in the future.</p>
<p>please note the inline comment. Awaiting your response there.</p><hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3583#discussion_r346896407">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>:</p>
<pre style='color:#555'>> -        boolean result = storedData.getOwnerPubKey() != null && storedData.getOwnerPubKey().equals(ownerPubKey);
-        if (!result)
-            log.warn("New data entry does not match our stored data. storedData.ownerPubKey=" +
-                    (storedData.getOwnerPubKey() != null ? storedData.getOwnerPubKey().toString() : "null") +
-                    ", ownerPubKey=" + ownerPubKey);
-
-        return result;
-    }
-
-    private boolean checkIfStoredMailboxDataMatchesNewMailboxData(PublicKey receiversPubKey, ByteArray hashOfData) {
-        ProtectedStorageEntry storedData = map.get(hashOfData);
-        if (storedData instanceof ProtectedMailboxStorageEntry) {
-            ProtectedMailboxStorageEntry entry = (ProtectedMailboxStorageEntry) storedData;
-            // publicKey is not the same (stored: sender, new: receiver)
-            boolean result = entry.getReceiversPubKey().equals(receiversPubKey)
-                    && get32ByteHashAsByteArray(entry.getProtectedStoragePayload()).equals(hashOfData);
</pre>
<p>you did not migrate the hash calculation and comparison to the <code>ProtectedMailboxStorageEntry</code>. Can you elaborate?</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/3583?email_source=notifications&email_token=AJFFTNWS24QJ4R7KZXR2NVDQT3CZLA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLX7QWA#pullrequestreview-317716568">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNQQUXABXGS46APJQR3QT3CZLANCNFSM4JLCP7CA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNRZGJIUFRVLY2FTPVTQT3CZLA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLX7QWA.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/3583?email_source=notifications\u0026email_token=AJFFTNWS24QJ4R7KZXR2NVDQT3CZLA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLX7QWA#pullrequestreview-317716568",
"url": "https://github.com/bisq-network/bisq/pull/3583?email_source=notifications\u0026email_token=AJFFTNWS24QJ4R7KZXR2NVDQT3CZLA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLX7QWA#pullrequestreview-317716568",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>