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

Function is_p2wpkh

bitcoin/script.c:469–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469bool is_p2wpkh(const u8 *script, struct bitcoin_address *addr)
470{
471 size_t script_len = tal_count(script);
472
473 if (script_len != BITCOIN_SCRIPTPUBKEY_P2WPKH_LEN)
474 return false;
475 if (script[0] != OP_0)
476 return false;
477 if (script[1] != OP_PUSHBYTES(sizeof(struct ripemd160)))
478 return false;
479 if (addr)
480 memcpy(addr, script+2, sizeof(*addr));
481 return true;
482}
483
484bool is_known_scripttype(const u8 *script)
485{

Callers 7

is_known_scripttypeFunction · 0.70
wallet_can_spendFunction · 0.50
encode_fFunction · 0.50
json_add_fallbackFunction · 0.50
is_segwit_outputFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected