Skip to content

Commit

Permalink
channeld: don't forget channels that we've put funds into
Browse files Browse the repository at this point in the history
Typically we forget a channel if 2016 blocks have passed and
the funding transaction hasn't been mined yet, however we
SHOULD NOT forget these channels if we've got funds in them!
  • Loading branch information
niftynei committed Jul 20, 2021
1 parent 03ccebc commit 0dde74f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lightningd/channel_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,10 @@ is_fundee_should_forget(struct lightningd *ld,
if (block_height - channel->first_blocknum < max_funding_unconfirmed)
return false;

/* If we've got funds in the channel, don't forget it */
if (!amount_sat_zero(channel->our_funds))
return false;

/* Ah forget it! */
return true;
}
Expand Down

0 comments on commit 0dde74f

Please sign in to comment.