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

Function is_p2wpkh

bitcoin/script.c:525–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523}
524
525bool is_p2wpkh(const u8 *script, size_t script_len, struct bitcoin_address *addr)
526{
527 if (script_len != BITCOIN_SCRIPTPUBKEY_P2WPKH_LEN)
528 return false;
529 if (script[0] != OP_0)
530 return false;
531 if (script[1] != OP_PUSHBYTES(sizeof(struct ripemd160)))
532 return false;
533 if (addr)
534 memcpy(addr, script+2, sizeof(*addr));
535 return true;
536}
537
538bool is_p2tr(const u8 *script, size_t script_len, u8 xonly_pubkey[32])
539{

Callers 10

is_known_scripttypeFunction · 0.85
psbt_input_get_weightFunction · 0.85
json_signmessagewithkeyFunction · 0.85
wallet_stmt2outputFunction · 0.85
encode_fFunction · 0.85
json_add_fallbackFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected