From eb776ea296fbbd7dfd58dda367be75d36f7bed59 Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:43:46 -0400 Subject: [PATCH] fix dropped messages on startup before ready --- .../core/support/traderchat/TraderChatManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/main/java/haveno/core/support/traderchat/TraderChatManager.java b/core/src/main/java/haveno/core/support/traderchat/TraderChatManager.java index 7279c6021e..34fb6ae98f 100644 --- a/core/src/main/java/haveno/core/support/traderchat/TraderChatManager.java +++ b/core/src/main/java/haveno/core/support/traderchat/TraderChatManager.java @@ -32,6 +32,7 @@ import haveno.core.trade.Trade; import haveno.core.trade.TradeManager; import haveno.core.xmr.wallet.XmrWalletService; import haveno.network.p2p.AckMessageSourceType; +import haveno.network.p2p.BootstrapListener; import haveno.network.p2p.NodeAddress; import haveno.network.p2p.P2PService; import java.util.List; @@ -139,6 +140,19 @@ public class TraderChatManager extends SupportManager { @Override public void onAllServicesInitialized() { super.onAllServicesInitialized(); + + p2PService.addP2PServiceListener(new BootstrapListener() { + @Override + public void onDataReceived() { + tryApplyMessages(); + } + }); + + xmrWalletService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> { + if (xmrWalletService.isSyncedWithinTolerance()) + tryApplyMessages(); + }); + tryApplyMessages(); }