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

Function bitcoin_wscript_anchor

bitcoin/script.c:856–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856u8 *bitcoin_wscript_anchor(const tal_t *ctx,
857 const struct pubkey *funding_pubkey)
858{
859 u8 *script = tal_arr(ctx, u8, 0);
860
861 /* BOLT #3:
862 * #### `to_local_anchor` and `to_remote_anchor` Output (option_anchors)
863 *...
864 * <local_funding_pubkey/remote_funding_pubkey> OP_CHECKSIG OP_IFDUP
865 * OP_NOTIF
866 * OP_16 OP_CHECKSEQUENCEVERIFY
867 * OP_ENDIF
868 */
869 add_push_key(&script, funding_pubkey);
870 add_op(&script, OP_CHECKSIG);
871 add_op(&script, OP_IFDUP);
872 add_op(&script, OP_NOTIF);
873 add_number(&script, 16);
874 add_op(&script, OP_CHECKSEQUENCEVERIFY);
875 add_op(&script, OP_ENDIF);
876
877 return script;
878}
879
880bool scripteq(const u8 *s1, const u8 *s2)
881{

Callers 2

get_anchor_scriptpubkeysFunction · 0.85
tx_add_anchor_outputFunction · 0.85

Calls 3

add_push_keyFunction · 0.85
add_opFunction · 0.85
add_numberFunction · 0.85

Tested by

no test coverage detected