commit_tx: take raw funding keys instead of wscript.

It now needs the keys for anchor outputs, so have it calculate
the 2 of 2 wscript internally.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-08-14 03:16:02 +09:30
parent d8d1014ca4
commit 222d018b1a
8 changed files with 55 additions and 17 deletions

View File

@@ -62,7 +62,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
const struct bitcoin_txid *funding_txid,
unsigned int funding_txout,
struct amount_sat funding,
u8 *funding_wscript,
const struct pubkey funding_key[NUM_SIDES],
enum side opener,
u16 to_self_delay,
const struct keyset *keyset,
@@ -85,6 +85,9 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
u32 sequence;
void *dummy_local = (void *)LOCAL, *dummy_remote = (void *)REMOTE;
const void *output_order[NUM_SIDES];
const u8 *funding_wscript = bitcoin_redeem_2of2(tmpctx,
&funding_key[LOCAL],
&funding_key[REMOTE]);
if (!amount_msat_add(&total_pay, self_pay, other_pay))
abort();