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

Julian Knutsen notifications at github.com
Fri Nov 15 16:35:57 UTC 2019


julianknutsen commented on this pull request.



>  
-            if (hasSequenceNrIncreased) {
-                sequenceNumberMap.put(hashOfPayload, new MapValue(protectedStorageEntry.getSequenceNumber(), System.currentTimeMillis()));
-                // We set the delay higher as we might receive a batch of items
-                sequenceNumberMapStorage.queueUpForSave(SequenceNumberMap.clone(sequenceNumberMap), 2000);
+        // If we have seen a more recent operation for this payload, we ignore the current one

We don't necessarily see a different version of the payload as the contents are identical, but we do see different operations on that payload that increment the sequence number.

The producers of change (add/remove/refresh) always increment the SeqNr so it acts like a timestamp for which operations take precedence over one another. For example, a Remove operation with SeqNr 2 is superseded by an add with SeqNr 3.

In that way of thinking, it made sense to me that the SeqNrs are more tied to the operations that occur and less about the payload version.

Hope that helps.



-- 
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_r346909418
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191115/624f705c/attachment.html>


More information about the bisq-github mailing list