]> git.bitcoin.ninja Git - rust-lightning/commit
Close and remove unfunded inbound/outbound channels that are older than an hour
authorDuncan Dean <git@dunxen.dev>
Fri, 14 Jul 2023 14:59:29 +0000 (16:59 +0200)
committerDuncan Dean <git@dunxen.dev>
Wed, 19 Jul 2023 17:12:10 +0000 (19:12 +0200)
commit50a6d41d265941b7d394750ba3e3ff11f18defec
tree35390452e765187a4bd813bcb3ccdf4f0650d576
parentb4d082b833422b9f055ea920462b0771ebfc3b2b
Close and remove unfunded inbound/outbound channels that are older than an hour

We introduce a `UnfundedChannelContext` which contains a counter for the
current age of an unfunded channel in timer ticks. This age is incremented
for every `ChannelManager::timer_tick_ocurred` and the unfunded channel
is removed if it exceeds `UNFUNDED_CHANNEL_AGE_LIMIT_TICKS`.

The value will not be persisted as unfunded channels themselves are not
persisted.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs