struct bitcoin_tx: remove explicit lengths, use tal_len()/tal_count()

They're always tal objects, so we can simply ask tal for the length,
simplifying the API.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-01-25 10:05:43 +10:30
parent ad82d29379
commit 8522a5ea64
20 changed files with 166 additions and 187 deletions

View File

@@ -90,18 +90,18 @@ u8 **bitcoin_witness_htlc(const tal_t *ctx,
const u8 *witnessscript);
/* Is this a pay to pubkeu hash? */
bool is_p2pkh(const u8 *script, size_t script_len);
bool is_p2pkh(const u8 *script);
/* Is this a pay to script hash? */
bool is_p2sh(const u8 *script, size_t script_len);
bool is_p2sh(const u8 *script);
/* Is this (version 0) pay to witness script hash? */
bool is_p2wsh(const u8 *script, size_t script_len);
bool is_p2wsh(const u8 *script);
/* Is this (version 0) pay to witness pubkey hash? */
bool is_p2wpkh(const u8 *script, size_t script_len);
bool is_p2wpkh(const u8 *script);
/* Are these two scripts equal? */
bool scripteq(const u8 *s1, size_t s1len, const u8 *s2, size_t s2len);
bool scripteq(const tal_t *s1, const tal_t *s2);
#endif /* LIGHTNING_BITCOIN_SCRIPT_H */