| 536 | } |
| 537 | |
| 538 | bool is_p2tr(const u8 *script, size_t script_len, u8 xonly_pubkey[32]) |
| 539 | { |
| 540 | if (script_len != BITCOIN_SCRIPTPUBKEY_P2TR_LEN) |
| 541 | return false; |
| 542 | if (script[0] != OP_1) |
| 543 | return false; |
| 544 | /* x-only pubkey */ |
| 545 | if (script[1] != OP_PUSHBYTES(32)) |
| 546 | return false; |
| 547 | if (xonly_pubkey) |
| 548 | memcpy(xonly_pubkey, script+2, 32); |
| 549 | return true; |
| 550 | } |
| 551 | |
| 552 | bool is_known_scripttype(const u8 *script, size_t script_len) |
| 553 | { |
no outgoing calls
no test coverage detected