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

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3640#discussion_r350126071">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>:</p>
<pre style='color:#555'>> @@ -418,9 +418,8 @@ public boolean addProtectedStorageEntry(ProtectedStorageEntry protectedStorageEn
 
         // Persist ProtectedStorageEntrys carrying PersistablePayload payloads and signal listeners on changes
         if (protectedStoragePayload instanceof PersistablePayload) {
-            ProtectedStorageEntry previous = protectedDataStoreService.putIfAbsent(hashOfPayload, protectedStorageEntry);
-            if (previous == null)
-                protectedDataStoreListeners.forEach(e -> e.onAdded(protectedStorageEntry));
+            protectedDataStoreService.put(hashOfPayload, protectedStorageEntry);
</pre>
<p>This means that we will have a lot more save procedures. Looking at the code in <code>FileManager:75</code> ff. I feel not confident to do this change now as we significantly up the risk of having corrupted data stores - which is very bad.</p>
<p>Just by a quick look at the filemanager code, I doubt that this is thread-safe. There seems to be an obvious race condition in 79-83. Can we have that tested and fixed if needed before we apply this patch?</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/3640?email_source=notifications&email_token=AJFFTNWE2ZOKIAAOLDEC3YDQVOY6BA5CNFSM4JPMQYFKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCM2H2DQ#pullrequestreview-322206990">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNWFZFTOJLAHLHZBX5TQVOY6BANCNFSM4JPMQYFA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNU2OVLP46TBNA6F5MLQVOY6BA5CNFSM4JPMQYFKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCM2H2DQ.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/3640?email_source=notifications\u0026email_token=AJFFTNWE2ZOKIAAOLDEC3YDQVOY6BA5CNFSM4JPMQYFKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCM2H2DQ#pullrequestreview-322206990",
"url": "https://github.com/bisq-network/bisq/pull/3640?email_source=notifications\u0026email_token=AJFFTNWE2ZOKIAAOLDEC3YDQVOY6BA5CNFSM4JPMQYFKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCM2H2DQ#pullrequestreview-322206990",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>