[bisq-network/bisq] (6/6) Clean up technical debt in P2PDataStorage and ProtectedStorageEntry objects (#3747)
Christoph Atteneder
notifications at github.com
Mon Dec 9 12:12:05 UTC 2019
ripcurlx commented on this pull request.
> - Utilities.toTruncatedString(toRemoveItem.getValue()));
- });
- removeFromMapAndDataStore(toRemoveList);
-
- if (sequenceNumberMap.size() > this.maxSequenceNumberMapSizeBeforePurge)
- sequenceNumberMap.setMap(getPurgedSequenceNumberMap(sequenceNumberMap.getMap()));
+ // Backdate all the eligible payloads based on the node that disconnected
+ map.values().stream()
+ .filter(protectedStorageEntry -> protectedStorageEntry.getProtectedStoragePayload() instanceof ExpirablePayload)
+ .filter(protectedStorageEntry -> protectedStorageEntry.getProtectedStoragePayload() instanceof RequiresOwnerIsOnlinePayload)
+ .filter(protectedStorageEntry -> ((RequiresOwnerIsOnlinePayload) protectedStorageEntry.getProtectedStoragePayload()).getOwnerNodeAddress().equals(peersNodeAddress))
+ .forEach(protectedStorageEntry -> {
+ // We only set the data back by half of the TTL and remove the data only if is has
+ // expired after that back dating.
+ // We might get connection drops which are not caused by the node going offline, so
+ // we give more tolerance with that approach, giving the node the change to
NIT: The `change` != `chance` typo in the original code is copied over to this place as well.
--
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/3747#pullrequestreview-328875958
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191209/d2cf504c/attachment.html>
More information about the bisq-github
mailing list