mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-05 11:39:35 +01:00
Block UI popups in api startup's encrypted wallet init
Running the UI's walletPasswordHandler during wallet initialization will fail and block wallet initialization. This change ensures an encrypted wallet does not trigger a walletPasswordHandler.run() if isApiUser=true during startup.
This commit is contained in:
parent
0fd7efd80f
commit
dd2b17fde7
1 changed files with 7 additions and 3 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
package bisq.core.app;
|
||||
|
||||
import bisq.core.api.CoreContext;
|
||||
import bisq.core.btc.exceptions.InvalidHostException;
|
||||
import bisq.core.btc.exceptions.RejectedTxException;
|
||||
import bisq.core.btc.setup.WalletsSetup;
|
||||
|
@ -63,6 +64,7 @@ import javax.annotation.Nullable;
|
|||
@Singleton
|
||||
public class WalletAppSetup {
|
||||
|
||||
private final CoreContext coreContext;
|
||||
private final WalletsManager walletsManager;
|
||||
private final WalletsSetup walletsSetup;
|
||||
private final FeeService feeService;
|
||||
|
@ -86,11 +88,13 @@ public class WalletAppSetup {
|
|||
private final BooleanProperty useTorForBTC = new SimpleBooleanProperty();
|
||||
|
||||
@Inject
|
||||
public WalletAppSetup(WalletsManager walletsManager,
|
||||
public WalletAppSetup(CoreContext coreContext,
|
||||
WalletsManager walletsManager,
|
||||
WalletsSetup walletsSetup,
|
||||
FeeService feeService,
|
||||
Config config,
|
||||
Preferences preferences) {
|
||||
this.coreContext = coreContext;
|
||||
this.walletsManager = walletsManager;
|
||||
this.walletsSetup = walletsSetup;
|
||||
this.feeService = feeService;
|
||||
|
@ -172,10 +176,10 @@ public class WalletAppSetup {
|
|||
walletsSetup.initialize(null,
|
||||
() -> {
|
||||
// We only check one wallet as we apply encryption to all or none
|
||||
if (walletsManager.areWalletsEncrypted()) {
|
||||
if (walletsManager.areWalletsEncrypted() && !coreContext.isApiUser()) {
|
||||
walletPasswordHandler.run();
|
||||
} else {
|
||||
if (preferences.isResyncSpvRequested()) {
|
||||
if (preferences.isResyncSpvRequested() && !coreContext.isApiUser()) {
|
||||
if (showFirstPopupIfResyncSPVRequestedHandler != null)
|
||||
showFirstPopupIfResyncSPVRequestedHandler.run();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue