Commit 3c7e9db
committed
Add
It can be useful to get the stats on a potential commitment transaction
without actually building it. Therefore, this commit splits the stats
calculations from the actual build of a commitment transaction.
This introduces an extra loop over the pending htlcs when actually
building a commitment transaction, but current network behavior
produces very few concurrent htlcs on channels. Furthermore, each
iteration of the loop in the stats calculation is very cheap.
The motivating use case for `build_commitment_stats` is to calculate the
balances of the channel parties in order to validate the
`funding_contribution_satoshis` field of `splice_init` and `splice_ack`
messages without building a full commitment transaction.ChannelContext::build_commitment_stats
1 parent 7b45811 commit 3c7e9db
1 file changed
+255
-162
lines changed
0 commit comments