Create an output script using p2pkh */
| 186 | |
| 187 | /* Create an output script using p2pkh */ |
| 188 | u8 *scriptpubkey_p2pkh(const tal_t *ctx, const struct bitcoin_address *addr) |
| 189 | { |
| 190 | u8 *script = tal_arr(ctx, u8, 0); |
| 191 | |
| 192 | add_op(&script, OP_DUP); |
| 193 | add_op(&script, OP_HASH160); |
| 194 | script_push_bytes(&script, &addr->addr, sizeof(addr->addr)); |
| 195 | add_op(&script, OP_EQUALVERIFY); |
| 196 | add_op(&script, OP_CHECKSIG); |
| 197 | assert(tal_count(script) == BITCOIN_SCRIPTPUBKEY_P2PKH_LEN); |
| 198 | return script; |
| 199 | } |
| 200 | |
| 201 | /* Create an input script which spends p2pkh */ |
| 202 | u8 *bitcoin_redeem_p2pkh(const tal_t *ctx, const struct pubkey *pubkey, |
no test coverage detected