Handle missing case in reestablish local commitment number checks 2023-11-log-forward-peer
authorMatt Corallo <git@bluematt.me>
Thu, 9 Nov 2023 04:14:15 +0000 (04:14 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 27 Nov 2023 23:59:12 +0000 (23:59 +0000)
commitac3fd98ec178365cd6b9f6a108fab29b5cf0b550
treec6e023252656f85d627fd50a94fa6569063230a5
parentf24830719af671f2998a42c3ce248147e94fe0d2
Handle missing case in reestablish local commitment number checks

If we're behind exactly one commitment (which we've revoked), we'd
previously force-close the channel, guaranteeing we'll lose funds
as the counterparty has our latest local commitment state's
revocation secret.

While this shouldn't happen because users should never lose data,
sometimes issues happen, and we should ensure we always panic.

Further, `test_data_loss_protect` is updated to test this case.
lightning/src/ln/channel.rs
lightning/src/ln/reload_tests.rs