mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Add missing allServicesInitialized check
This commit is contained in:
parent
29e957a7ca
commit
855cb4f620
@ -108,8 +108,6 @@ public class DisputeManager implements PersistedDataHost {
|
||||
private final Map<String, Subscription> disputeIsClosedSubscriptionsMap = new HashMap<>();
|
||||
@Getter
|
||||
private final IntegerProperty numOpenDisputes = new SimpleIntegerProperty();
|
||||
private boolean servicesInitialized;
|
||||
|
||||
@Getter
|
||||
private final ChatManager chatManager;
|
||||
|
||||
@ -160,7 +158,7 @@ public class DisputeManager implements PersistedDataHost {
|
||||
}
|
||||
|
||||
public void onAllServicesInitialized() {
|
||||
servicesInitialized = true;
|
||||
chatManager.onAllServicesInitialized();
|
||||
p2PService.addP2PServiceListener(new BootstrapListener() {
|
||||
@Override
|
||||
public void onUpdatedDataReceived() {
|
||||
|
@ -59,6 +59,7 @@ public class ChatManager {
|
||||
|
||||
private final CopyOnWriteArraySet<DecryptedMessageWithPubKey> decryptedMailboxMessageWithPubKeys = new CopyOnWriteArraySet<>();
|
||||
private final CopyOnWriteArraySet<DecryptedMessageWithPubKey> decryptedDirectMessageWithPubKeys = new CopyOnWriteArraySet<>();
|
||||
private boolean allServicesInitialized;
|
||||
|
||||
public ChatManager(P2PService p2PService,
|
||||
WalletsSetup walletsSetup
|
||||
@ -77,13 +78,18 @@ public class ChatManager {
|
||||
});
|
||||
}
|
||||
|
||||
public void onAllServicesInitialized() {
|
||||
allServicesInitialized = true;
|
||||
}
|
||||
|
||||
public void tryApplyMessages() {
|
||||
if (isReadyForTxBroadcast())
|
||||
applyMessages();
|
||||
}
|
||||
|
||||
private boolean isReadyForTxBroadcast() {
|
||||
return p2PService.isBootstrapped() &&
|
||||
return allServicesInitialized &&
|
||||
p2PService.isBootstrapped() &&
|
||||
walletsSetup.isDownloadComplete() &&
|
||||
walletsSetup.hasSufficientPeersForBroadcast();
|
||||
}
|
||||
@ -139,7 +145,8 @@ public class ChatManager {
|
||||
sendAckMessage(disputeCommunicationMessage, receiverPubKeyRing, true, null);
|
||||
}
|
||||
|
||||
private void processAckMessage(AckMessage ackMessage, @Nullable DecryptedMessageWithPubKey decryptedMessageWithPubKey) {
|
||||
private void processAckMessage(AckMessage ackMessage,
|
||||
@Nullable DecryptedMessageWithPubKey decryptedMessageWithPubKey) {
|
||||
if (ackMessage.getSourceType() == AckMessageSourceType.DISPUTE_MESSAGE) {
|
||||
if (ackMessage.isSuccess()) {
|
||||
log.info("Received AckMessage for {} with tradeId {} and uid {}",
|
||||
|
Loading…
Reference in New Issue
Block a user