Skip to content

Commit

Permalink
Merge pull request #4916 from chimp1984/fix-access-from-wrong-thread-…
Browse files Browse the repository at this point in the history
…at-wallet-restore

Property fields must not be set from non JavaFX threads.
  • Loading branch information
sqrrm authored Dec 14, 2020
2 parents 7d12b94 + cd98617 commit 0e7dd21
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/main/java/bisq/core/btc/setup/WalletsSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,16 @@ protected void onSetupCompleted() {
return message;
});

chainHeight.set(chain.getBestChainHeight());
chain.addNewBestBlockListener(block -> {
connectedPeers.set(peerGroup.getConnectedPeers());
chainHeight.set(block.getHeight());
UserThread.execute(() -> {
connectedPeers.set(peerGroup.getConnectedPeers());
chainHeight.set(block.getHeight());
});
});

// Map to user thread
UserThread.execute(() -> {
chainHeight.set(chain.getBestChainHeight());
addressEntryList.onWalletReady(walletConfig.btcWallet());
timeoutTimer.stop();
setupCompletedHandlers.forEach(Runnable::run);
Expand Down

0 comments on commit 0e7dd21

Please sign in to comment.