Rework get_latest_holder_commitment_txn to broadcast for users
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Tue, 30 Jan 2024 22:45:44 +0000 (14:45 -0800)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Wed, 7 Feb 2024 23:42:26 +0000 (15:42 -0800)
commit71b4bd0811f32b0a4bf81d8eebc46d2fff001d1b
treef1aad91f2b3da5b716c7ab97a9e8d400366d779b
parente0323ec049ab3b3fea14537d1b6776bcfc38e8d3
Rework get_latest_holder_commitment_txn to broadcast for users

This method is meant to be used as a last resort when a user is forced
to broadcast the current state, even if it is stale, in an attempt to
claim their funds in the channel. Previously, we'd return the commitment
and HTLC transactions such that they broadcast them themselves. Doing so
required a different code path, one which was not tested, to obtain
these transactions than our usual path when force closing. It's not
worth maintaining both, and it's much simpler for us to broadcast
instead.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/monitor_tests.rs