Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for initialized wallet before processing dispute msgs, fix #2914 #2915

Merged
merged 2 commits into from
Jun 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion core/src/main/java/bisq/core/arbitration/DisputeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public class DisputeManager implements PersistedDataHost {
private final Map<String, Subscription> disputeIsClosedSubscriptionsMap = new HashMap<>();
@Getter
private final IntegerProperty numOpenDisputes = new SimpleIntegerProperty();
private boolean servicesInitialized;


///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -177,6 +178,7 @@ public void readPersisted() {
}

public void onAllServicesInitialized() {
servicesInitialized = true;
p2PService.addP2PServiceListener(new BootstrapListener() {
@Override
public void onUpdatedDataReceived() {
Expand Down Expand Up @@ -260,9 +262,13 @@ private void tryApplyMessages() {
}

private boolean isReadyForTxBroadcast() {
// Some messages can't be handled until all the services are properly initialized.
// In particular it's not possible to complete the signing of a dispute payout
// by an encrypted wallet until after it's been decrypted.
return p2PService.isBootstrapped() &&
walletsSetup.isDownloadComplete() &&
walletsSetup.hasSufficientPeersForBroadcast();
walletsSetup.hasSufficientPeersForBroadcast() &&
servicesInitialized;
}

private void applyMessages() {
Expand Down