fix dropped messages on startup before ready

This commit is contained in:
woodser 2025-09-15 10:43:46 -04:00 committed by woodser
parent 6bc74d2ee8
commit eb776ea296

View file

@ -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();
}