| 523 | } |
| 524 | |
| 525 | bool is_p2wpkh(const u8 *script, size_t script_len, struct bitcoin_address *addr) |
| 526 | { |
| 527 | if (script_len != BITCOIN_SCRIPTPUBKEY_P2WPKH_LEN) |
| 528 | return false; |
| 529 | if (script[0] != OP_0) |
| 530 | return false; |
| 531 | if (script[1] != OP_PUSHBYTES(sizeof(struct ripemd160))) |
| 532 | return false; |
| 533 | if (addr) |
| 534 | memcpy(addr, script+2, sizeof(*addr)); |
| 535 | return true; |
| 536 | } |
| 537 | |
| 538 | bool is_p2tr(const u8 *script, size_t script_len, u8 xonly_pubkey[32]) |
| 539 | { |
no outgoing calls
no test coverage detected