| 154 | } |
| 155 | |
| 156 | u8 *scriptpubkey_p2sh_hash(const tal_t *ctx, const struct ripemd160 *redeemhash) |
| 157 | { |
| 158 | u8 *script = tal_arr(ctx, u8, 0); |
| 159 | |
| 160 | add_op(&script, OP_HASH160); |
| 161 | script_push_bytes(&script, redeemhash->u.u8, sizeof(redeemhash->u.u8)); |
| 162 | add_op(&script, OP_EQUAL); |
| 163 | assert(tal_count(script) == BITCOIN_SCRIPTPUBKEY_P2SH_LEN); |
| 164 | return script; |
| 165 | } |
| 166 | |
| 167 | /* Create p2sh for this redeem script. */ |
| 168 | u8 *scriptpubkey_p2sh(const tal_t *ctx, const u8 *redeemscript) |
no test coverage detected