mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 12:16:27 -04:00
Back date data of object on disconnect, and only remove object if is is expired
This commit is contained in:
parent
500fa2826e
commit
bf86f0a7e4
1 changed files with 12 additions and 3 deletions
|
@ -165,8 +165,17 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
||||||
" / isIntended=" + closeConnectionReason.isIntended +
|
" / isIntended=" + closeConnectionReason.isIntended +
|
||||||
" / peer=" + (connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown"));
|
" / peer=" + (connection.getPeersNodeAddressOptional().isPresent() ? connection.getPeersNodeAddressOptional().get() : "PeersNode unknown"));
|
||||||
|
|
||||||
// TODO We get closeConnectionReason TERMINATED which removes offers which should not be removed
|
// We only set the data back by half of the TTL and remove the data only if is has
|
||||||
// TODO investigate why EOFException happens
|
// expired after tha 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
|
||||||
|
// refresh the TTL with a refresh message.
|
||||||
|
// We observed those issues during stress tests, but it might have been caused by the
|
||||||
|
// test set up (many nodes/connections over 1 router)
|
||||||
|
// TODO investigate what causes the disconnections.
|
||||||
|
// Usually the are: SOCKET_TIMEOUT ,TERMINATED (EOFException)
|
||||||
|
protectedData.backDate();
|
||||||
|
if (protectedData.isExpired())
|
||||||
doRemoveProtectedExpirableData(protectedData, hashOfPayload);
|
doRemoveProtectedExpirableData(protectedData, hashOfPayload);
|
||||||
} else {
|
} else {
|
||||||
log.debug("Remove data ignored as we don't have an entry for that data.");
|
log.debug("Remove data ignored as we don't have an entry for that data.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue