Skip to content

Commit

Permalink
onchaind: don't tell lightningd to send OUR_DELAYED_RETURN_TO_WALLET …
Browse files Browse the repository at this point in the history
…too early (leases).

current height + to_self_delay[LOCAL] is correct normally, but if we
have an outstanding lease it's longer.  Not a big issue, because
lightningd will retry until its spendable, but wrong.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Feb 24, 2025
1 parent 8c0b233 commit 5078e79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions onchaind/onchaind.c
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@ static void our_unilateral_to_us(struct tracked_output ***outs,
const struct bitcoin_outpoint *outpoint,
u32 tx_blockheight,
struct amount_sat amt,
u16 sequence,
u32 sequence,
const u8 *local_scriptpubkey,
const u8 *local_wscript)
{
Expand All @@ -2156,7 +2156,7 @@ static void our_unilateral_to_us(struct tracked_output ***outs,

msg = towire_onchaind_spend_to_us(NULL,
outpoint, amt,
rel_blockheight(out, to_self_delay[LOCAL]),
rel_blockheight(out, sequence),
commit_num,
local_wscript);

Expand All @@ -2166,7 +2166,7 @@ static void our_unilateral_to_us(struct tracked_output ***outs,
* output is *resolved* by the spending transaction
*/
propose_resolution_to_master(out, take(msg),
rel_blockheight(out, to_self_delay[LOCAL]),
rel_blockheight(out, sequence),
OUR_DELAYED_RETURN_TO_WALLET);
}

Expand Down

0 comments on commit 5078e79

Please sign in to comment.