mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
script: add helper for checking if a 'known type'
To be used for verifying remote inputs' validity
This commit is contained in:
committed by
Rusty Russell
parent
6f85088b2b
commit
cb2cad8c94
@@ -436,6 +436,12 @@ bool is_p2wpkh(const u8 *script, struct bitcoin_address *addr)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool is_known_scripttype(const u8 *script)
|
||||
{
|
||||
return is_p2wpkh(script, NULL) || is_p2wsh(script, NULL)
|
||||
|| is_p2sh(script, NULL) || is_p2pkh(script, NULL);
|
||||
}
|
||||
|
||||
u8 **bitcoin_witness_sig_and_element(const tal_t *ctx,
|
||||
const struct bitcoin_signature *sig,
|
||||
const void *elem, size_t elemsize,
|
||||
|
||||
Reference in New Issue
Block a user