mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-10-14 03:20:46 -04:00
fix dropped messages on startup before ready
This commit is contained in:
parent
6bc74d2ee8
commit
eb776ea296
1 changed files with 14 additions and 0 deletions
|
@ -32,6 +32,7 @@ import haveno.core.trade.Trade;
|
||||||
import haveno.core.trade.TradeManager;
|
import haveno.core.trade.TradeManager;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import haveno.network.p2p.AckMessageSourceType;
|
import haveno.network.p2p.AckMessageSourceType;
|
||||||
|
import haveno.network.p2p.BootstrapListener;
|
||||||
import haveno.network.p2p.NodeAddress;
|
import haveno.network.p2p.NodeAddress;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -139,6 +140,19 @@ public class TraderChatManager extends SupportManager {
|
||||||
@Override
|
@Override
|
||||||
public void onAllServicesInitialized() {
|
public void onAllServicesInitialized() {
|
||||||
super.onAllServicesInitialized();
|
super.onAllServicesInitialized();
|
||||||
|
|
||||||
|
p2PService.addP2PServiceListener(new BootstrapListener() {
|
||||||
|
@Override
|
||||||
|
public void onDataReceived() {
|
||||||
|
tryApplyMessages();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
xmrWalletService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
if (xmrWalletService.isSyncedWithinTolerance())
|
||||||
|
tryApplyMessages();
|
||||||
|
});
|
||||||
|
|
||||||
tryApplyMessages();
|
tryApplyMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue