channeld: don't forget channels that we've put funds into

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!
This commit is contained in:
niftynei 2021-07-02 15:21:54 -05:00 committed by neil saitug
parent 03ccebc296
commit 0dde74f99e

View File

@ -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;
}