Track previous ChannelConfig and expire after enough ticks
authorWilmer Paulino <wilmer.paulino@gmail.com>
Thu, 16 Jun 2022 23:24:42 +0000 (16:24 -0700)
committerWilmer Paulino <wilmer.paulino@gmail.com>
Mon, 20 Jun 2022 20:12:49 +0000 (13:12 -0700)
commite2f216b694cfc2302e97280f9e9a6775941fd563
treee253ab972cef6502909b6bcb66538d12de5ede8e
parent3dff4abfb1610862920ea36765424b609887ab2f
Track previous ChannelConfig and expire after enough ticks

We do this to prevent payment failures while the `ChannelUpdate` for the
new `ChannelConfig` still propagates throughout the network. In a follow
up commit, we'll honor forwarding HTLCs that were constructed based on
either the previous or current `ChannelConfig`.

To handle expiration (when we should stop allowing the previous config),
we rely on the ChannelManager's `timer_tick_occurred` method. After
enough ticks, the previous config is cleared from memory, and only the
current config applies moving forward.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs