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

Function is_p2wsh

bitcoin/script.c:454–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454bool is_p2wsh(const u8 *script, struct sha256 *addr)
455{
456 size_t script_len = tal_count(script);
457
458 if (script_len != BITCOIN_SCRIPTPUBKEY_P2WSH_LEN)
459 return false;
460 if (script[0] != OP_0)
461 return false;
462 if (script[1] != OP_PUSHBYTES(sizeof(struct sha256)))
463 return false;
464 if (addr)
465 memcpy(addr, script+2, sizeof(struct sha256));
466 return true;
467}
468
469bool is_p2wpkh(const u8 *script, struct bitcoin_address *addr)
470{

Callers 9

match_htlc_outputFunction · 0.85
is_known_scripttypeFunction · 0.85
topo_add_utxosFunction · 0.85
encode_fFunction · 0.85
json_add_fallbackFunction · 0.85
is_segwit_outputFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected