From 2e2b077f0e6e2358e16e48b6fd893282879efa8f Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 20 Nov 2023 08:25:52 -0500 Subject: [PATCH] increase distributed mailbox message max size to 50000 --- .../java/haveno/network/p2p/mailbox/MailboxMessageService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2p/src/main/java/haveno/network/p2p/mailbox/MailboxMessageService.java b/p2p/src/main/java/haveno/network/p2p/mailbox/MailboxMessageService.java index 5249a7caf2..5d2ce5b779 100644 --- a/p2p/src/main/java/haveno/network/p2p/mailbox/MailboxMessageService.java +++ b/p2p/src/main/java/haveno/network/p2p/mailbox/MailboxMessageService.java @@ -104,6 +104,7 @@ import static com.google.common.base.Preconditions.checkNotNull; @Slf4j public class MailboxMessageService implements HashMapChangedListener, PersistedDataHost { private static final long REPUBLISH_DELAY_SEC = TimeUnit.MINUTES.toSeconds(2); + private static final long MAX_SERIALIZED_SIZE = 50000; private final NetworkNode networkNode; private final PeerManager peerManager; @@ -180,7 +181,7 @@ public class MailboxMessageService implements HashMapChangedListener, PersistedD // persisted data the messages, they would add those again and distribute then later at requests to peers. // Those outdated messages would then stay in the network until TTL triggers removal. // By not applying large messages we reduce the impact of such cases at costs of extra loading costs if the message is still alive. - if (serializedSize < 20000) { + if (serializedSize < MAX_SERIALIZED_SIZE) { mailboxItemsByUid.put(mailboxItem.getUid(), mailboxItem); mailboxMessageList.add(mailboxItem); totalSize.getAndAdd(serializedSize);