mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
lease_rates: add csv lock to modify anchor scripts
This commit is contained in:
@@ -51,9 +51,10 @@ bool try_subtract_fee(enum side opener, enum side side,
|
||||
|
||||
u8 *to_self_wscript(const tal_t *ctx,
|
||||
u16 to_self_delay,
|
||||
u32 csv,
|
||||
const struct keyset *keyset)
|
||||
{
|
||||
return bitcoin_wscript_to_local(ctx, to_self_delay,
|
||||
return bitcoin_wscript_to_local(ctx, to_self_delay, csv,
|
||||
&keyset->self_revocation_key,
|
||||
&keyset->self_delayed_payment_key);
|
||||
}
|
||||
@@ -87,6 +88,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
|
||||
u64 obscured_commitment_number,
|
||||
struct wally_tx_output *direct_outputs[NUM_SIDES],
|
||||
enum side side,
|
||||
u32 csv_lock,
|
||||
bool option_anchor_outputs,
|
||||
char** err_reason)
|
||||
{
|
||||
@@ -208,7 +210,9 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
|
||||
* output](#to_local-output).
|
||||
*/
|
||||
if (amount_msat_greater_eq_sat(self_pay, dust_limit)) {
|
||||
u8 *wscript = to_self_wscript(tmpctx, to_self_delay, keyset);
|
||||
u8 *wscript = to_self_wscript(tmpctx,
|
||||
to_self_delay, csv_lock,
|
||||
keyset);
|
||||
amount = amount_msat_to_sat_round_down(self_pay);
|
||||
int pos = bitcoin_tx_add_output(
|
||||
tx, scriptpubkey_p2wsh(tx, wscript), wscript, amount);
|
||||
@@ -242,7 +246,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
|
||||
amount = amount_msat_to_sat_round_down(other_pay);
|
||||
if (option_anchor_outputs) {
|
||||
scriptpubkey = scriptpubkey_p2wsh(tmpctx,
|
||||
anchor_to_remote_redeem(tmpctx, &keyset->other_payment_key, 1));
|
||||
anchor_to_remote_redeem(tmpctx, &keyset->other_payment_key, csv_lock));
|
||||
} else {
|
||||
scriptpubkey = scriptpubkey_p2wpkh(tmpctx,
|
||||
&keyset->other_payment_key);
|
||||
|
||||
Reference in New Issue
Block a user