From fec8f6e3e2450939d7b4f3a08d2248ed94dbc689 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Wed, 4 Nov 2020 12:34:43 -0500 Subject: [PATCH] Add comments, revert TTL change at AckMessage as it has no effect anyway --- p2p/src/main/java/bisq/network/p2p/AckMessage.java | 7 ++++++- .../network/p2p/storage/payload/MailboxStoragePayload.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/p2p/src/main/java/bisq/network/p2p/AckMessage.java b/p2p/src/main/java/bisq/network/p2p/AckMessage.java index ca62210ed5f..fea3fa0a33f 100644 --- a/p2p/src/main/java/bisq/network/p2p/AckMessage.java +++ b/p2p/src/main/java/bisq/network/p2p/AckMessage.java @@ -34,6 +34,10 @@ import javax.annotation.Nullable; +// TODO ExpirablePayload has no effect here as it is either a direct msg or packed into MailboxStoragePayload +// We could extend the TTL by setting the TTL in MailboxStoragePayload from the type of msg which gets into the +// SealedAndSigned data. + // We exclude uid from hashcode and equals to detect duplicate entries of the same AckMessage @EqualsAndHashCode(callSuper = true, exclude = {"uid"}) @Value @@ -145,9 +149,10 @@ public static AckMessage fromProto(protobuf.AckMessage proto, int messageVersion // API /////////////////////////////////////////////////////////////////////////////////////////// + //TODO has no effect, see comment at class definition @Override public long getTTL() { - return TimeUnit.DAYS.toMillis(2); + return TimeUnit.DAYS.toMillis(10); } @Override diff --git a/p2p/src/main/java/bisq/network/p2p/storage/payload/MailboxStoragePayload.java b/p2p/src/main/java/bisq/network/p2p/storage/payload/MailboxStoragePayload.java index 5bed966ee2d..f50a5697a5c 100644 --- a/p2p/src/main/java/bisq/network/p2p/storage/payload/MailboxStoragePayload.java +++ b/p2p/src/main/java/bisq/network/p2p/storage/payload/MailboxStoragePayload.java @@ -47,6 +47,7 @@ * That is the typical requirement for a mailbox like system. *

* Typical payloads are trade or dispute network_messages to be stored when the peer is offline. + * Size depends on payload but typical size is 2000-3000 bytes */ @Getter @EqualsAndHashCode