[bisq-network/bisq] (3/4) [REFACTOR] P2PDataStore::add/remove/refresh (#3557)
Julian Knutsen
notifications at github.com
Wed Nov 6 00:38:55 UTC 2019
julianknutsen commented on this pull request.
>
- if (!containsKey || hasSequenceNrIncreased) {
- // At startup we don't have the item so we store it. At updates of the seq nr we store as well.
- map.put(hashOfPayload, protectedStorageEntry);
- hashMapChangedListeners.forEach(e -> e.onAdded(protectedStorageEntry));
- // printData("after add");
- } else {
- log.trace("We got that version of the data already, so we don't store it.");
- }
+ // If we have seen a more recent operation for this payload, we ignore the current one
+ // TODO: I think we can return false here. All callers use the get() public API which increments the sequence number
I agree. I'll add my thoughts about this on (4/4) to explain more about the current state and my opinion on where it should go to make it a bit easier to reason about. I agree that it is possible to client code may expect the current behavior and I will dig into each path individually to understand what happens on failure.
--
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_r342868321
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191105/540e06a9/attachment.html>
More information about the bisq-github
mailing list