| 165 | } |
| 166 | |
| 167 | u8 *scriptpubkey_p2sh_hash(const tal_t *ctx, const struct ripemd160 *redeemhash) |
| 168 | { |
| 169 | u8 *script = tal_arr(ctx, u8, 0); |
| 170 | |
| 171 | add_op(&script, OP_HASH160); |
| 172 | script_push_bytes(&script, redeemhash->u.u8, sizeof(redeemhash->u.u8)); |
| 173 | add_op(&script, OP_EQUAL); |
| 174 | assert(tal_count(script) == BITCOIN_SCRIPTPUBKEY_P2SH_LEN); |
| 175 | return script; |
| 176 | } |
| 177 | |
| 178 | /* Create p2sh for this redeem script. */ |
| 179 | u8 *scriptpubkey_p2sh(const tal_t *ctx, const u8 *redeemscript) |
no test coverage detected