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

Function scriptpubkey_p2sh_hash

bitcoin/script.c:156–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156u8 *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. */
168u8 *scriptpubkey_p2sh(const tal_t *ctx, const u8 *redeemscript)

Callers 3

scriptpubkey_p2shFunction · 0.85
decode_fFunction · 0.85

Calls 2

add_opFunction · 0.85
script_push_bytesFunction · 0.70

Tested by

no test coverage detected