mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
lightningd: don't try to "save" incoming channel by closing early if incoming already onchain.
From test_penalty_htlc_tx_timeout[False] flake (with keys replaced by l2 and l5, for clarity) ``` lightningd-3 2024-06-04T04:34:00.942Z UNUSUAL l2-chan#1: Peer permanent failure in CHANNELD_NORMAL: Funding transaction spent lightningd-3 2024-06-04T04:34:01.570Z UNUSUAL l5-chan#3: Peer permanent failure in CHANNELD_NORMAL: Funding transaction spent lightningd-3 2024-06-04T04:34:01.655Z UNUSUAL l5-chan#3: Abandoning unresolved onchain HTLC at block 132 (expired at 125) to avoid peer closing incoming HTLC at block 131 lightningd-3 2024-06-04T04:34:02.802Z **BROKEN** l5-chan#3: FUNDS LOSS of 50000000msat: peer took funds onchain before we could time out the HTLC, but we abandoned incoming HTLC to save the incoming channel ``` So, we were already closing l2, no reason to abandon it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
db67df3364
commit
1a1696f2f9
1 changed files with 4 additions and 0 deletions
|
@ -2700,6 +2700,10 @@ static void consider_failing_incoming(struct lightningd *ld,
|
|||
if (height + 3 < hout->in->cltv_expiry)
|
||||
return;
|
||||
|
||||
/* Unless incoming is already onchain, then it can't get worse! */
|
||||
if (!channel_state_can_remove_htlc(hout->in->key.channel->state))
|
||||
return;
|
||||
|
||||
log_unusual(hout->key.channel->log,
|
||||
"Abandoning unresolved onchain HTLC at block %u"
|
||||
" (expired at %u) to avoid peer closing incoming HTLC at block %u",
|
||||
|
|
Loading…
Add table
Reference in a new issue