MCPcopy Create free account
hub / github.com/ElementsProject/lightning / scriptpubkey_p2wpkh

Function scriptpubkey_p2wpkh

bitcoin/script.c:281–290  ·  view source on GitHub ↗

Create an output script for a 20-byte witness. */

Source from the content-addressed store, hash-verified

279
280/* Create an output script for a 20-byte witness. */
281u8 *scriptpubkey_p2wpkh(const tal_t *ctx, const struct pubkey *key)
282{
283 struct ripemd160 h;
284 u8 *script = tal_arr(ctx, u8, 0);
285
286 add_op(&script, OP_0);
287 pubkey_to_hash160(key, &h);
288 script_push_bytes(&script, &h, sizeof(h));
289 return script;
290}
291
292u8 *scriptpubkey_p2wpkh_derkey(const tal_t *ctx, const u8 der[33])
293{

Callers 10

scriptpubkey_to_remoteFunction · 0.85
commit_txFunction · 0.85
p2wpkh_for_keyidxFunction · 0.85
onchaind_tx_unsignedFunction · 0.85
initial_commit_txFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

add_opFunction · 0.85
pubkey_to_hash160Function · 0.85
script_push_bytesFunction · 0.85

Tested by

no test coverage detected