Add feerate and balances to `LatestCounterpartyCommitmentTXInfo`
authorAlec Chen <alecchendev@gmail.com>
Wed, 14 Jun 2023 20:14:14 +0000 (15:14 -0500)
committerAlec Chen <alecchendev@gmail.com>
Wed, 23 Aug 2023 15:48:19 +0000 (10:48 -0500)
commit543ad4fd23c1f52e2afa68bbd09d3213d9e2761d
treeeeaf7919a31b599ac448a24cbe15a91cf90ec21f
parent0c250468d632ed6df93d8a9d34389a2cb61eac40
Add feerate and balances to `LatestCounterpartyCommitmentTXInfo`

This adds the feerate and local and remote output values to this channel
monitor update step so that a monitor can reconstruct the counterparty's
commitment transaction from an update. These commitment transactions
will be exposed to users in the following commits to support third-party
watchtowers in the persistence pipeline.

With only the HTLC outputs currently available in the monitor update, we
can tell how much of the channel balance is in-flight and towards which
side, however it doesn't tell us the amount that resides on either side.
Because of dust, we can't reliably derive the remote value from the
local value and visa versa. Thus, it seems these are the minimum fields
that need to be added.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channel.rs