common/shutdown_scriptpubkey: extract shutdown scriptpubkey test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-02-19 14:52:01 +10:30
parent ebb1b19c65
commit 66dda32da2
5 changed files with 35 additions and 15 deletions

View File

@@ -0,0 +1,10 @@
#include <bitcoin/script.h>
#include <common/shutdown_scriptpubkey.h>
bool valid_shutdown_scriptpubkey(const u8 *scriptpubkey)
{
return is_p2pkh(scriptpubkey, NULL)
|| is_p2sh(scriptpubkey, NULL)
|| is_p2wpkh(scriptpubkey, NULL)
|| is_p2wsh(scriptpubkey, NULL);
}