| 510 | } |
| 511 | |
| 512 | bool 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 | |
| 525 | bool is_p2wpkh(const u8 *script, size_t script_len, struct bitcoin_address *addr) |
| 526 | { |
no outgoing calls
no test coverage detected