mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-19 14:44:10 +01:00
fix mailbox bootstrap issue
This commit is contained in:
parent
c1d6ea93bb
commit
62e71e1ccb
@ -334,12 +334,14 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
||||
|
||||
p2PDataStorage.onBootstrapped();
|
||||
|
||||
// We don't use a listener at mailboxMessageService as we require the correct
|
||||
// order of execution. The mailboxMessageService must be called before.
|
||||
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();
|
||||
mailboxMessageService.initAfterBootstrapped();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,13 +221,18 @@ public class MailboxMessageService implements HashMapChangedListener, PersistedD
|
||||
public void onBootstrapped() {
|
||||
if (!isBootstrapped) {
|
||||
isBootstrapped = true;
|
||||
// Only now we start listening and processing. The p2PDataStorage is our cache for data we have received
|
||||
// after the hidden service was ready.
|
||||
addHashMapChangedListenerAndApply();
|
||||
maybeRepublishMailBoxMessages();
|
||||
}
|
||||
}
|
||||
|
||||
// second stage starup for MailboxMessageService ... apply existing messages to their modules
|
||||
public void initAfterBootstrapped() {
|
||||
// Only now we start listening and processing. The p2PDataStorage is our cache for data we have received
|
||||
// after the hidden service was ready.
|
||||
addHashMapChangedListener();
|
||||
onAdded(p2PDataStorage.getMap().values());
|
||||
maybeRepublishMailBoxMessages();
|
||||
}
|
||||
|
||||
|
||||
public void sendEncryptedMailboxMessage(NodeAddress peer,
|
||||
PubKeyRing peersPubKeyRing,
|
||||
@ -374,9 +379,8 @@ public class MailboxMessageService implements HashMapChangedListener, PersistedD
|
||||
// Private
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void addHashMapChangedListenerAndApply() {
|
||||
private void addHashMapChangedListener() {
|
||||
p2PDataStorage.addHashMapChangedListener(this);
|
||||
onAdded(p2PDataStorage.getMap().values());
|
||||
}
|
||||
|
||||
private void processSingleMailboxEntry(Collection<ProtectedMailboxStorageEntry> protectedMailboxStorageEntries) {
|
||||
|
Loading…
Reference in New Issue
Block a user