| 73 | } |
| 74 | |
| 75 | bool valid_shutdown_scriptpubkey(const u8 *scriptpubkey, |
| 76 | bool anysegwit, |
| 77 | bool allow_oldstyle, |
| 78 | bool option_simple_close) |
| 79 | { |
| 80 | const size_t script_len = tal_bytelen(scriptpubkey); |
| 81 | if (allow_oldstyle) { |
| 82 | if (is_p2pkh(scriptpubkey, script_len, NULL) |
| 83 | || is_p2sh(scriptpubkey, script_len, NULL)) |
| 84 | return true; |
| 85 | } |
| 86 | |
| 87 | return is_p2wpkh(scriptpubkey, script_len, NULL) |
| 88 | || is_p2wsh(scriptpubkey, script_len, NULL) |
| 89 | || (anysegwit && is_valid_witnessprog(scriptpubkey, script_len)) |
| 90 | || (option_simple_close && is_valid_op_return(scriptpubkey, script_len)); |
| 91 | } |
no test coverage detected