From 0e5c7e5de798c72c974aecedc648172eb05e69ae Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Mon, 22 Feb 2021 17:56:30 -0600 Subject: [PATCH] Fix initialization ordering issue TradeManager must be inited before MailboxMessageService --- .../main/java/bisq/core/app/DomainInitialisation.java | 2 +- p2p/src/main/java/bisq/network/p2p/P2PService.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/bisq/core/app/DomainInitialisation.java b/core/src/main/java/bisq/core/app/DomainInitialisation.java index 8bdc28c989d..a5aa26c236c 100644 --- a/core/src/main/java/bisq/core/app/DomainInitialisation.java +++ b/core/src/main/java/bisq/core/app/DomainInitialisation.java @@ -196,12 +196,12 @@ public void initDomainServices(Consumer rejectedTxErrorMessageHandler, tradeLimits.onAllServicesInitialized(); + tradeManager.onAllServicesInitialized(); arbitrationManager.onAllServicesInitialized(); mediationManager.onAllServicesInitialized(); refundManager.onAllServicesInitialized(); traderChatManager.onAllServicesInitialized(); - tradeManager.onAllServicesInitialized(); closedTradableManager.onAllServicesInitialized(); failedTradesManager.onAllServicesInitialized(); xmrTxProofService.onAllServicesInitialized(); diff --git a/p2p/src/main/java/bisq/network/p2p/P2PService.java b/p2p/src/main/java/bisq/network/p2p/P2PService.java index 0bac8ac70bf..6f363ddc31f 100644 --- a/p2p/src/main/java/bisq/network/p2p/P2PService.java +++ b/p2p/src/main/java/bisq/network/p2p/P2PService.java @@ -334,13 +334,12 @@ private void applyIsBootstrapped(Consumer listenerHandler) { p2PDataStorage.onBootstrapped(); - // We don't use a listener at mailboxMessageService as we require the correct - // order of execution. The p2pServiceListeners must be called after - // mailboxMessageService.onUpdatedDataReceived. - mailboxMessageService.onBootstrapped(); - // Once we have applied the state in the P2P domain we notify our listeners p2pServiceListeners.forEach(listenerHandler); + + // We don't use a listener at mailboxMessageService as we require the correct + // order of execution. The p2pServiceListeners must be called before. + mailboxMessageService.onBootstrapped(); } }