mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 12:26:45 +00:00
show discover button when adding accounts on a bitcoin core connection, but warn user account discovery is not generally supported if no accounts are found
This commit is contained in:
parent
c9b40b1973
commit
646b8b0e65
2 changed files with 9 additions and 4 deletions
|
@ -69,8 +69,7 @@ public class AddAccountDialog extends Dialog<List<StandardAccount>> {
|
|||
}
|
||||
|
||||
final ButtonType discoverButtonType = new javafx.scene.control.ButtonType("Discover", ButtonBar.ButtonData.LEFT);
|
||||
if(!availableAccounts.isEmpty() && Config.get().getServerType() != ServerType.BITCOIN_CORE &&
|
||||
(masterWallet.getKeystores().stream().allMatch(ks -> ks.getSource() == KeystoreSource.SW_SEED)
|
||||
if(!availableAccounts.isEmpty() && (masterWallet.getKeystores().stream().allMatch(ks -> ks.getSource() == KeystoreSource.SW_SEED)
|
||||
|| (masterWallet.getKeystores().size() == 1 && masterWallet.getKeystores().stream().allMatch(ks -> ks.getSource() == KeystoreSource.HW_USB)))) {
|
||||
dialogPane.getButtonTypes().add(discoverButtonType);
|
||||
Button discoverButton = (Button)dialogPane.lookupButton(discoverButtonType);
|
||||
|
|
|
@ -15,9 +15,11 @@ import com.sparrowwallet.sparrow.AppServices;
|
|||
import com.sparrowwallet.sparrow.EventManager;
|
||||
import com.sparrowwallet.sparrow.control.*;
|
||||
import com.sparrowwallet.sparrow.event.*;
|
||||
import com.sparrowwallet.sparrow.io.Config;
|
||||
import com.sparrowwallet.sparrow.io.Storage;
|
||||
import com.sparrowwallet.sparrow.io.StorageException;
|
||||
import com.sparrowwallet.sparrow.net.ElectrumServer;
|
||||
import com.sparrowwallet.sparrow.net.ServerType;
|
||||
import com.sparrowwallet.sparrow.whirlpool.WhirlpoolServices;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
|
@ -629,7 +631,9 @@ public class SettingsController extends WalletFormController implements Initiali
|
|||
accountDiscoveryService.setOnSucceeded(event -> {
|
||||
addAndEncryptAccounts(masterWallet, accountDiscoveryService.getValue(), key);
|
||||
if(accountDiscoveryService.getValue().isEmpty()) {
|
||||
AppServices.showAlertDialog("No Accounts Found", "No new accounts with existing transactions were found. Note only the first 10 accounts are scanned.", Alert.AlertType.INFORMATION, ButtonType.OK);
|
||||
AppServices.showAlertDialog("No Accounts Found", "No new accounts with existing transactions were found. " +
|
||||
(Config.get().getServerType() == ServerType.BITCOIN_CORE ? "Note the configured server type is Bitcoin Core, which does not support account discovery." : "Note only the next 10 accounts are scanned."),
|
||||
Alert.AlertType.INFORMATION, ButtonType.OK);
|
||||
}
|
||||
});
|
||||
accountDiscoveryService.setOnFailed(event -> {
|
||||
|
@ -667,7 +671,9 @@ public class SettingsController extends WalletFormController implements Initiali
|
|||
accountDiscoveryService.setOnSucceeded(event -> {
|
||||
addAndSaveAccounts(masterWallet, accountDiscoveryService.getValue(), null);
|
||||
if(accountDiscoveryService.getValue().isEmpty()) {
|
||||
AppServices.showAlertDialog("No Accounts Found", "No new accounts with existing transactions were found. Note only the first 10 accounts are scanned.", Alert.AlertType.INFORMATION, ButtonType.OK);
|
||||
AppServices.showAlertDialog("No Accounts Found", "No new accounts with existing transactions were found. " +
|
||||
(Config.get().getServerType() == ServerType.BITCOIN_CORE ? "Note the configured server type is Bitcoin Core, which does not support account discovery." : "Note only the next 10 accounts are scanned."),
|
||||
Alert.AlertType.INFORMATION, ButtonType.OK);
|
||||
}
|
||||
});
|
||||
accountDiscoveryService.setOnFailed(event -> {
|
||||
|
|
Loading…
Reference in a new issue