[bisq-network/bisq] Fix initialization ordering issue (#5219)

jmacxx notifications at github.com
Tue Feb 23 02:41:35 CET 2021


Fixes #5210 

TradeManager must be inited before MailboxMessageService.  Fixes two NPE scenarios described in #5210 

### Scenario 1.  Start up with a Mailbox message queued for delivery to DisputeManager

- This relates to the first call stack posted in #5210.
- The mailbox message service is initialized and propagates the message synchronously up to DisputeManager
- DisputeManager queries the Trade associated with the Dispute.  
- We get an NPE while attempting to access `Trade -> processModel -> provider` as the TradeManager has not yet been initialized via `initPersistedTrades`.
- The solution is to bootstrap the MailboxMessageService last so that any messages it dispatches are received by initialized services.


### Scenario 2.  Start up with a password protected wallet.

- Same pre-conditions as before, + have password protection set on Bob's wallet.
- After entering the password we get the [second NPE](https://github.com/bisq-network/bisq/issues/5210#issuecomment-783579294) described.
- The call stack shows that the initialization route located at `DomainInitialisation::initDomainServices()` is used.  It needs to call `tradeManager.onAllServicesInitialized()` before `arbitrationManager / mediationManager / refundManager` are started.


You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5219

-- Commit Summary --

  * Fix initialization ordering issue

-- File Changes --

    M core/src/main/java/bisq/core/app/DomainInitialisation.java (2)
    M p2p/src/main/java/bisq/network/p2p/P2PService.java (9)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5219.patch
https://github.com/bisq-network/bisq/pull/5219.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210222/e2c88100/attachment.htm>


More information about the bisq-github mailing list