mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
improve error message when importing invalid coldcard multisig config
This commit is contained in:
parent
1187925543
commit
87cc28e0a4
1 changed files with 5 additions and 6 deletions
|
@ -7,10 +7,7 @@ import com.sparrowwallet.drongo.Utils;
|
||||||
import com.sparrowwallet.drongo.policy.Policy;
|
import com.sparrowwallet.drongo.policy.Policy;
|
||||||
import com.sparrowwallet.drongo.policy.PolicyType;
|
import com.sparrowwallet.drongo.policy.PolicyType;
|
||||||
import com.sparrowwallet.drongo.protocol.ScriptType;
|
import com.sparrowwallet.drongo.protocol.ScriptType;
|
||||||
import com.sparrowwallet.drongo.wallet.Keystore;
|
import com.sparrowwallet.drongo.wallet.*;
|
||||||
import com.sparrowwallet.drongo.wallet.KeystoreSource;
|
|
||||||
import com.sparrowwallet.drongo.wallet.Wallet;
|
|
||||||
import com.sparrowwallet.drongo.wallet.WalletModel;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -174,8 +171,10 @@ public class ColdcardMultisig implements WalletImport, KeystoreFileImport, Walle
|
||||||
wallet.setDefaultPolicy(policy);
|
wallet.setDefaultPolicy(policy);
|
||||||
wallet.setScriptType(scriptType);
|
wallet.setScriptType(scriptType);
|
||||||
|
|
||||||
if(!wallet.isValid()) {
|
try {
|
||||||
throw new IllegalStateException("This file does not describe a valid wallet. " + getKeystoreImportDescription());
|
wallet.checkWallet();
|
||||||
|
} catch(InvalidWalletException e) {
|
||||||
|
throw new IllegalStateException("This file does not describe a valid wallet: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return wallet;
|
return wallet;
|
||||||
|
|
Loading…
Reference in a new issue