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

Function is_p2wsh

bitcoin/script.c:512–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512bool is_p2wsh(const u8 *script, size_t script_len, struct sha256 *addr)
513{
514 if (script_len != BITCOIN_SCRIPTPUBKEY_P2WSH_LEN)
515 return false;
516 if (script[0] != OP_0)
517 return false;
518 if (script[1] != OP_PUSHBYTES(sizeof(struct sha256)))
519 return false;
520 if (addr)
521 memcpy(addr, script+2, sizeof(struct sha256));
522 return true;
523}
524
525bool is_p2wpkh(const u8 *script, size_t script_len, struct bitcoin_address *addr)
526{

Callers 12

match_htlc_outputFunction · 0.85
is_known_scripttypeFunction · 0.85
psbt_input_get_weightFunction · 0.85
wallet_stmt2outputFunction · 0.85
topo_add_utxosFunction · 0.85
encode_fFunction · 0.85
json_add_fallbackFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected