[bisq-network/bisq] (6/6) Clean up technical debt in P2PDataStorage and ProtectedStorageEntry objects (#3747)
Julian Knutsen
notifications at github.com
Mon Dec 9 17:15:01 UTC 2019
julianknutsen commented on this pull request.
> + NodeAddress peersNodeAddress = connection.getPeersNodeAddressOptional().get();
+
+ // Retrieve all the eligible payloads based on the node that disconnected
+ ArrayList<Map.Entry<ByteArray, ProtectedStorageEntry>> toBackDate =
+ map.entrySet().stream()
+ .filter(entry -> entry.getValue().getProtectedStoragePayload() instanceof ExpirablePayload)
+ .filter(entry -> entry.getValue().getProtectedStoragePayload() instanceof RequiresOwnerIsOnlinePayload)
+ .filter(entry -> ((RequiresOwnerIsOnlinePayload) entry.getValue().getProtectedStoragePayload()).getOwnerNodeAddress().equals(peersNodeAddress))
+ .collect(Collectors.toCollection(ArrayList::new));
+
+ // Backdate each payload
+ toBackDate.forEach(mapEntry -> {
+ // 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
Addressed in e8c8225
--
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#discussion_r355574965
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191209/c9dff233/attachment.html>
More information about the bisq-github
mailing list