diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 47527c76..97ec9264 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -2,6 +2,9 @@ name: Package on: workflow_dispatch +permissions: + contents: read + jobs: build: runs-on: ${{ matrix.os }} diff --git a/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java b/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java index 85248689..f20a58b2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java +++ b/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java @@ -646,6 +646,8 @@ public class ServerPreferencesController extends PreferencesDetailController { reason += "\n\nSee https://sparrowwallet.com/docs/connect-node.html"; } else if(reason != null && (reason.startsWith("Cannot connect to hidden service"))) { reason += " on the server. Check that the onion address and port are correct, and that both Tor and the Electrum server are running on the node. Usually SSL is not enabled, and the port is 50001."; + } else if(reason != null && (reason.startsWith("Cannot find Bitcoin Core cookie file at"))) { + reason += "\n\nMake sure server=1 has been added to bitcoin.conf"; } testResults.setText("Could not connect:\n\n" + reason); diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java index b7e93dca..7bcf11d2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java @@ -37,6 +37,7 @@ import tornadofx.control.Field; import javax.smartcardio.CardException; import java.net.URL; import java.util.Base64; +import java.util.Locale; import java.util.Optional; import java.util.ResourceBundle; import java.util.stream.Collectors; @@ -370,6 +371,14 @@ public class KeystoreController extends WalletFormController implements Initiali selectSourcePane.setVisible(false); Keystore importedKeystore = result.get(); + if(keystore.getSource() == KeystoreSource.SW_SEED && importedKeystore.getSource() != KeystoreSource.SW_SEED) { + Optional optType = AppServices.showWarningDialog("Confirm Replacement", + "You are replacing a software wallet with a " + importedKeystore.getSource().getDisplayName().toLowerCase(Locale.ROOT) + ", which will remove the seed. Are you sure?", + ButtonType.NO, ButtonType.YES); + if(optType.isPresent() && optType.get() == ButtonType.NO) { + return; + } + } walletForm.getWallet().makeLabelsUnique(importedKeystore); keystore.setSource(importedKeystore.getSource()); keystore.setWalletModel(importedKeystore.getWalletModel());