bitcoin/signature: BIP143 signature support.

We hand in the witness_script: if non-NULL, we use BIP143-style
signature hash creation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-04-12 13:05:51 +09:30
parent 8545db418b
commit df5d4e3c10
6 changed files with 125 additions and 7 deletions

View File

@@ -45,7 +45,8 @@ void bitcoin_txid(const struct bitcoin_tx *tx, struct sha256_double *txid);
/* Useful for signature code. */
void sha256_tx_for_sig(struct sha256_double *h, const struct bitcoin_tx *tx,
unsigned int input_num, enum sighash_type stype);
unsigned int input_num, enum sighash_type stype,
const u8 *witness_script);
/* Linear bytes of tx. */
u8 *linearize_tx(const tal_t *ctx, const struct bitcoin_tx *tx);