Create an output script using p2pkh */
| 175 | |
| 176 | /* Create an output script using p2pkh */ |
| 177 | u8 *scriptpubkey_p2pkh(const tal_t *ctx, const struct bitcoin_address *addr) |
| 178 | { |
| 179 | u8 *script = tal_arr(ctx, u8, 0); |
| 180 | |
| 181 | add_op(&script, OP_DUP); |
| 182 | add_op(&script, OP_HASH160); |
| 183 | script_push_bytes(&script, &addr->addr, sizeof(addr->addr)); |
| 184 | add_op(&script, OP_EQUALVERIFY); |
| 185 | add_op(&script, OP_CHECKSIG); |
| 186 | assert(tal_count(script) == BITCOIN_SCRIPTPUBKEY_P2PKH_LEN); |
| 187 | return script; |
| 188 | } |
| 189 | |
| 190 | u8 *scriptpubkey_opreturn_padded(const tal_t *ctx) |
| 191 | { |
no test coverage detected