handle coldcard singlesig file imports containing p2sh-p2wsh

This commit is contained in:
Craig Raw 2024-04-10 07:44:24 +02:00
parent 5f98eb9eb9
commit 2441b4d7c3

View file

@ -72,7 +72,7 @@ public class ColdcardSinglesig implements KeystoreFileImport, WalletImport {
ColdcardKeystore ck = gson.fromJson(map.get(key), ColdcardKeystore.class); ColdcardKeystore ck = gson.fromJson(map.get(key), ColdcardKeystore.class);
if(ck.name != null) { if(ck.name != null) {
ScriptType ckScriptType = ScriptType.valueOf(ck.name.replace("p2wpkh-p2sh", "p2sh_p2wpkh").replace("p2sh-p2wpkh", "p2sh_p2wpkh").toUpperCase(Locale.ROOT)); ScriptType ckScriptType = ScriptType.valueOf(ck.name.replace("p2wpkh-p2sh", "p2sh_p2wpkh").replace("-", "_").toUpperCase(Locale.ROOT));
if(ckScriptType.equals(scriptType)) { if(ckScriptType.equals(scriptType)) {
Keystore keystore = new Keystore(); Keystore keystore = new Keystore();
keystore.setLabel(getName()); keystore.setLabel(getName());