Browse Source

allow multisig wallets with many (up to 50) keystores

terminal
Craig Raw 4 years ago
parent
commit
6339c3a7d7
  1. 2
      drongo
  2. 2
      src/main/java/com/sparrowwallet/sparrow/AppServices.java
  3. 6
      src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java

2
drongo

@ -1 +1 @@
Subproject commit eab42c0f0580452968f579bba3904bfc6480ae0f Subproject commit 2eedd2290cbe1dd559247f1ee934cece81fa7419

2
src/main/java/com/sparrowwallet/sparrow/AppServices.java

@ -898,7 +898,7 @@ public class AppServices {
Platform.runLater(() -> { Platform.runLater(() -> {
if(!Window.getWindows().isEmpty()) { if(!Window.getWindows().isEmpty()) {
List<File> walletFiles = allWallets.stream().filter(walletTabData -> walletTabData.getWallet().getMasterWallet() == null).map(walletTabData -> walletTabData.getStorage().getWalletFile()).collect(Collectors.toList()); List<File> walletFiles = allWallets.stream().filter(walletTabData -> walletTabData.getWallet().getMasterWallet() == null).map(walletTabData -> walletTabData.getStorage().getWalletFile()).filter(File::exists).collect(Collectors.toList());
Config.get().setRecentWalletFiles(Config.get().isLoadRecentWallets() ? walletFiles : Collections.emptyList()); Config.get().setRecentWalletFiles(Config.get().isLoadRecentWallets() ? walletFiles : Collections.emptyList());
} }
}); });

6
src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java

@ -142,6 +142,11 @@ public class SettingsController extends WalletFormController implements Initiali
multisigControl.lowValueProperty().addListener((observable, oldValue, threshold) -> { multisigControl.lowValueProperty().addListener((observable, oldValue, threshold) -> {
EventManager.get().post(new SettingsChangedEvent(walletForm.getWallet(), SettingsChangedEvent.Type.MUTLISIG_THRESHOLD)); EventManager.get().post(new SettingsChangedEvent(walletForm.getWallet(), SettingsChangedEvent.Type.MUTLISIG_THRESHOLD));
}); });
multisigControl.highValueProperty().addListener((observable, oldValue, newValue) -> {
if(newValue.doubleValue() == multisigControl.getMax() && newValue.doubleValue() <= 49.0) {
multisigControl.setMax(newValue.doubleValue() + 1.0);
}
});
multisigFieldset.managedProperty().bind(multisigFieldset.visibleProperty()); multisigFieldset.managedProperty().bind(multisigFieldset.visibleProperty());
@ -223,6 +228,7 @@ public class SettingsController extends WalletFormController implements Initiali
if(wallet.getPolicyType().equals(PolicyType.SINGLE)) { if(wallet.getPolicyType().equals(PolicyType.SINGLE)) {
totalKeystores.setValue(1); totalKeystores.setValue(1);
} else if(wallet.getPolicyType().equals(PolicyType.MULTI)) { } else if(wallet.getPolicyType().equals(PolicyType.MULTI)) {
multisigControl.setMax(Math.max(multisigControl.getMax(), wallet.getKeystores().size()));
multisigControl.lowValueProperty().set(wallet.getDefaultPolicy().getNumSignaturesRequired()); multisigControl.lowValueProperty().set(wallet.getDefaultPolicy().getNumSignaturesRequired());
multisigControl.highValueProperty().set(wallet.getKeystores().size()); multisigControl.highValueProperty().set(wallet.getKeystores().size());
totalKeystores.bind(multisigControl.highValueProperty()); totalKeystores.bind(multisigControl.highValueProperty());

Loading…
Cancel
Save