support tr script expressions in qr crypto-output

This commit is contained in:
Craig Raw
2021-11-12 17:18:24 +02:00
parent 8f04d23b3f
commit c566dea232
3 changed files with 6 additions and 2 deletions
@@ -515,6 +515,8 @@ public class QRScanDialog extends Dialog<QRScanDialog.Result> {
return ScriptType.P2SH_P2WSH;
} else if(List.of(ScriptExpression.WITNESS_SCRIPT_HASH).equals(expressions)) {
return ScriptType.P2WSH;
} else if(List.of(ScriptExpression.TAPROOT).equals(expressions)) {
return ScriptType.P2TR;
}
throw new IllegalArgumentException("Unknown script of " + expressions);
@@ -360,6 +360,8 @@ public class SettingsController extends WalletFormController implements Initiali
return List.of(ScriptExpression.SCRIPT_HASH, ScriptExpression.WITNESS_SCRIPT_HASH);
} else if(scriptType == ScriptType.P2WSH) {
return List.of(ScriptExpression.WITNESS_SCRIPT_HASH);
} else if(scriptType == ScriptType.P2TR) {
return List.of(ScriptExpression.TAPROOT);
}
throw new IllegalArgumentException("Unknown script type of " + scriptType);