| 452 | } |
| 453 | |
| 454 | bool 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 | |
| 469 | bool is_p2wpkh(const u8 *script, struct bitcoin_address *addr) |
| 470 | { |
no outgoing calls
no test coverage detected