allow multisig wallets with many (up to 50) keystores

This commit is contained in:
Craig Raw 2021-08-16 10:46:34 +02:00
parent 8f7f0d4c61
commit 6339c3a7d7
3 changed files with 8 additions and 2 deletions

2
drongo

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

View file

@ -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());
} }
}); });

View file

@ -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());