@Test public void testCreateP2SHOutputScript() { assertTrue(ScriptPattern.isP2SH( ScriptBuilder.createP2SHOutputScript(2, keys) )); }
public static boolean isP2SH(Script script) { List<ScriptChunk> chunks = script.chunks; if (chunks.size() != 3) return false; if (!chunks.get(0).equalsOpCode(OP_HASH160)) return false; ScriptChunk chunk1 = chunks.get(1); if (chunk1.opcode != 0x14) return false; byte[] chunk1data = chunk1.data; if (chunk1data == null) return false; if (chunk1data.length != LegacyAddress.LENGTH) return false; if (!chunks.get(2).equalsOpCode(OP_EQUAL)) return false; return true; }
ScriptPattern { public static boolean isP2SH(Script script) { List<ScriptChunk> chunks = script.chunks; if (chunks.size() != 3) return false; if (!chunks.get(0).equalsOpCode(OP_HASH160)) return false; ScriptChunk chunk1 = chunks.get(1); if (chunk1.opcode != 0x14) return false; byte[] chunk1data = chunk1.data; if (chunk1data == null) return false; if (chunk1data.length != LegacyAddress.LENGTH) return false; if (!chunks.get(2).equalsOpCode(OP_EQUAL)) return false; return true; } }
ScriptPattern { public static boolean isP2SH(Script script) { List<ScriptChunk> chunks = script.chunks; if (chunks.size() != 3) return false; if (!chunks.get(0).equalsOpCode(OP_HASH160)) return false; ScriptChunk chunk1 = chunks.get(1); if (chunk1.opcode != 0x14) return false; byte[] chunk1data = chunk1.data; if (chunk1data == null) return false; if (chunk1data.length != LegacyAddress.LENGTH) return false; if (!chunks.get(2).equalsOpCode(OP_EQUAL)) return false; return true; }  }
ScriptPattern { public static boolean isP2SH(Script script) { List<ScriptChunk> chunks = script.chunks; if (chunks.size() != 3) return false; if (!chunks.get(0).equalsOpCode(OP_HASH160)) return false; ScriptChunk chunk1 = chunks.get(1); if (chunk1.opcode != 0x14) return false; byte[] chunk1data = chunk1.data; if (chunk1data == null) return false; if (chunk1data.length != LegacyAddress.LENGTH) return false; if (!chunks.get(2).equalsOpCode(OP_EQUAL)) return false; return true; }  static boolean isP2PKH(Script script); static byte[] extractHashFromP2PKH(Script script); static boolean isP2SH(Script script); static byte[] extractHashFromP2SH(Script script); static boolean isP2PK(Script script); static byte[] extractKeyFromP2PK(Script script); static boolean isP2WH(Script script); static boolean isP2WPKH(Script script); static boolean isP2WSH(Script script); static byte[] extractHashFromP2WH(Script script); static boolean isSentToMultisig(Script script); static boolean isOpReturn(Script script); static boolean isWitnessCommitment(Script script); static Sha256Hash extractWitnessCommitmentHash(Script script); }
ScriptPattern { public static boolean isP2SH(Script script) { List<ScriptChunk> chunks = script.chunks; if (chunks.size() != 3) return false; if (!chunks.get(0).equalsOpCode(OP_HASH160)) return false; ScriptChunk chunk1 = chunks.get(1); if (chunk1.opcode != 0x14) return false; byte[] chunk1data = chunk1.data; if (chunk1data == null) return false; if (chunk1data.length != LegacyAddress.LENGTH) return false; if (!chunks.get(2).equalsOpCode(OP_EQUAL)) return false; return true; }  static boolean isP2PKH(Script script); static byte[] extractHashFromP2PKH(Script script); static boolean isP2SH(Script script); static byte[] extractHashFromP2SH(Script script); static boolean isP2PK(Script script); static byte[] extractKeyFromP2PK(Script script); static boolean isP2WH(Script script); static boolean isP2WPKH(Script script); static boolean isP2WSH(Script script); static byte[] extractHashFromP2WH(Script script); static boolean isSentToMultisig(Script script); static boolean isOpReturn(Script script); static boolean isWitnessCommitment(Script script); static Sha256Hash extractWitnessCommitmentHash(Script script);  }