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

Function scriptpubkey_p2sh_hash

bitcoin/script.c:167–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167u8 *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. */
179u8 *scriptpubkey_p2sh(const tal_t *ctx, const u8 *redeemscript)

Callers 4

scriptpubkey_p2shFunction · 0.85
decode_fFunction · 0.85

Calls 2

add_opFunction · 0.85
script_push_bytesFunction · 0.85

Tested by

no test coverage detected