<p><b>@ripcurlx</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3747#discussion_r355410279">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>:</p>
<pre style='color:#555'>> -                                    if (protectedStorageEntry.isExpired(this.clock)) {
-                                        log.info("We found an expired data entry which we have already back dated. " +
-                                                "We remove the protectedStoragePayload:\n\t" + Utilities.toTruncatedString(protectedStorageEntry.getProtectedStoragePayload(), 100));
-                                        removeFromMapAndDataStore(protectedStorageEntry, hashOfPayload);
-                                    }
-                                } else {
-                                    log.debug("Remove data ignored as we don't have an entry for that data.");
-                                }
-                            }
-                        }
-                    });
-        }
+        if (closeConnectionReason.isIntended)
+            return;
+
+        if (!connection.getPeersNodeAddressOptional().isPresent())
</pre>
<p>Is there a reason why you prefer using directly <code>getPeersNodeAddressOptional().isPresent()</code> in comparison using <code>hasPeerNodeAddress()</code> ? It is used mixed in the original code as well, so we might use one way for the future.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3747#discussion_r355412320">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>:</p>
<pre style='color:#555'>> +        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
</pre>
<p>NIT: Small typo in the original code: <code>change</code> should be <code>chance</code></p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3747#discussion_r355414457">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>:</p>
<pre style='color:#555'>> -                    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
</pre>
<p>NIT: The <code>change</code> != <code>chance</code> typo in the original code is copied over to this place as well.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/3747?email_source=notifications&email_token=AJFFTNXK2LPEFNDLK322XH3QXYYVHA5CNFSM4JVOFKAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCONCQ6I#pullrequestreview-328870009">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXOJ5M6K4SSUPMHT6TQXYYVHANCNFSM4JVOFKAA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNWBTJBEVBBBFGFMH3TQXYYVHA5CNFSM4JVOFKAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCONCQ6I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/3747?email_source=notifications\u0026email_token=AJFFTNXK2LPEFNDLK322XH3QXYYVHA5CNFSM4JVOFKAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCONCQ6I#pullrequestreview-328870009",
"url": "https://github.com/bisq-network/bisq/pull/3747?email_source=notifications\u0026email_token=AJFFTNXK2LPEFNDLK322XH3QXYYVHA5CNFSM4JVOFKAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCONCQ6I#pullrequestreview-328870009",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>