[bisq-network/bisq] (8/8) Test and Refactor P2PDataStorage Synchronization Path (#3667)

chimp1984 notifications at github.com
Tue Nov 26 02:44:10 UTC 2019


chimp1984 commented on this pull request.



> @@ -315,9 +308,7 @@ private boolean shouldTransmitPayloadToPeer(Capabilities peerCapabilities, Netwo
                 doAdd = true;
             }
             if (doAdd) {
-                boolean notContained = lookupSet.add(protectedStoragePayload.hashCode());

It deals with the case that there are multiple `ProtectedStorageEntry` objects with the same `ProtectedStoragePayload`. Not 100% sure if there are valid cases for that as the map in `P2PDataStorage` should not contain entries with the same `ProtectedStoragePayload`. There was the old `TradeStatistics` which was a `ProtectedStoragePayload` but that is not used anymore. The new is a `PersistableNetworkPayload`. For `TradeStatistics2` objects it is valid that we receive it 2 times (both traders are publishing it) in a different envelopes.

So I am not aware of any actual use case, but maybe it is better to keep that logic (maybe add a comment to make it easier to understand) to be able to support such a use case in future and to not break things if we have overlooked an existing use case. But I leave it to your consideration. You know that domain already better than myself... ;-)

-- 
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/3667#discussion_r350520366
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191125/2fc03d19/attachment.html>


More information about the bisq-github mailing list