mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
protocol: non-HTLC commit tx outputs are p2wpkh
This is changes the payments to either party to be p2wpkh. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
10
commit_tx.c
10
commit_tx.c
@@ -58,19 +58,17 @@ struct bitcoin_tx *create_commit_tx(const tal_t *ctx,
|
||||
tx->input[0].index = anchor_index;
|
||||
tx->input[0].amount = tal_dup(tx->input, u64, &anchor_satoshis);
|
||||
|
||||
/* First output is a P2SH to a complex redeem script (usu. for me) */
|
||||
/* First output is a P2WSH to a complex redeem script (usu. for me) */
|
||||
redeemscript = bitcoin_redeem_secret_or_delay(tx, our_final,
|
||||
their_locktime,
|
||||
their_final,
|
||||
rhash);
|
||||
tx->output[0].script = scriptpubkey_p2sh(tx, redeemscript);
|
||||
tx->output[0].script = scriptpubkey_p2wsh(tx, redeemscript);
|
||||
tx->output[0].script_length = tal_count(tx->output[0].script);
|
||||
tx->output[0].amount = cstate->a.pay_msat / 1000;
|
||||
|
||||
/* Second output is a P2SH payment to them. */
|
||||
tx->output[1].script = scriptpubkey_p2sh(tx,
|
||||
bitcoin_redeem_single(tx,
|
||||
their_final));
|
||||
/* Second output is a P2WPKH payment to them. */
|
||||
tx->output[1].script = scriptpubkey_p2wpkh(tx, their_final);
|
||||
tx->output[1].script_length = tal_count(tx->output[1].script);
|
||||
tx->output[1].amount = cstate->b.pay_msat / 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user