Skip to content

Commit

Permalink
Merge pull request #5219 from jmacxx/fix_issue_5210
Browse files Browse the repository at this point in the history
Fix initialization ordering issue
  • Loading branch information
ripcurlx authored Feb 24, 2021
2 parents dc38117 + d3b62b1 commit 7ffb1bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/app/DomainInitialisation.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ public void initDomainServices(Consumer<String> rejectedTxErrorMessageHandler,

tradeLimits.onAllServicesInitialized();

tradeManager.onAllServicesInitialized();
arbitrationManager.onAllServicesInitialized();
mediationManager.onAllServicesInitialized();
refundManager.onAllServicesInitialized();
traderChatManager.onAllServicesInitialized();

tradeManager.onAllServicesInitialized();
closedTradableManager.onAllServicesInitialized();
failedTradesManager.onAllServicesInitialized();
xmrTxProofService.onAllServicesInitialized();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ protected AckMessageSourceType getAckMessageSourceType() {
// API
///////////////////////////////////////////////////////////////////////////////////////////

public void onAllServicesInitialized() {
super.onAllServicesInitialized();
tryApplyMessages();
}

public void onSupportMessage(SupportMessage message) {
if (canProcessMessage(message)) {
log.info("Received {} with tradeId {} and uid {}",
Expand Down
9 changes: 4 additions & 5 deletions p2p/src/main/java/bisq/network/p2p/P2PService.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,12 @@ private void applyIsBootstrapped(Consumer<P2PServiceListener> 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();
}
}

Expand Down

0 comments on commit 7ffb1bc

Please sign in to comment.