show only addressable script types

This commit is contained in:
Craig Raw 2020-07-08 15:56:23 +02:00
parent 6135338df2
commit 687e235c94

View file

@ -1039,6 +1039,10 @@ public enum ScriptType {
return Arrays.stream(values()).filter(scriptType -> scriptType.isAllowed(policyType)).collect(Collectors.toList());
}
public static List<ScriptType> getAddressableScriptTypes(PolicyType policyType) {
return Arrays.stream(values()).filter(scriptType -> scriptType.isAllowed(policyType) && Arrays.asList(SINGLE_HASH_TYPES).contains(scriptType)).collect(Collectors.toList());
}
public static ScriptType getType(Script script) {
for(ScriptType type : values()) {
if(type.isScriptType(script)) {