| 467 | } |
| 468 | |
| 469 | bool 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 | |
| 484 | bool is_known_scripttype(const u8 *script) |
| 485 | { |
no outgoing calls
no test coverage detected