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

Function is_p2tr

bitcoin/script.c:538–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538bool is_p2tr(const u8 *script, size_t script_len, u8 xonly_pubkey[32])
539{
540 if (script_len != BITCOIN_SCRIPTPUBKEY_P2TR_LEN)
541 return false;
542 if (script[0] != OP_1)
543 return false;
544 /* x-only pubkey */
545 if (script[1] != OP_PUSHBYTES(32))
546 return false;
547 if (xonly_pubkey)
548 memcpy(xonly_pubkey, script+2, 32);
549 return true;
550}
551
552bool is_known_scripttype(const u8 *script, size_t script_len)
553{

Callers 10

is_known_scripttypeFunction · 0.70
psbt_input_get_weightFunction · 0.70
sign_our_inputsFunction · 0.50
wallet_stmt2outputFunction · 0.50
penalty_tx_createFunction · 0.50
json_add_fallbackFunction · 0.50
create_close_txFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected