Use ChannelMonitorUpdates in commitment signing fns in Channel
authorMatt Corallo <git@bluematt.me>
Sat, 8 Feb 2020 01:08:31 +0000 (20:08 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 27 Feb 2020 00:15:32 +0000 (19:15 -0500)
commitdf5053d3969689036582ffa46bf3da61b7238bf0
treeb68cb092fc463064d920cb266b2b2c1a0153ef0e
parent569f9038bec1f0ba09cfb01c35222a9365ee77d6
Use ChannelMonitorUpdates in commitment signing fns in Channel

This is a rather big step towards using the new ChannelMonitorUpdate
flow, using it in the various commitment signing and commitment
update message processing functions in Channel. Becase they all
often call each other, they all have to be updated as a group,
resulting in the somewhat large diff in this commit.

In order to keep the update_ids strictly increasing by one for
ease of use on the user end, we have to play some games with the
latest_monitor_update_id field, though its generally still pretty
readable, and the pattern of "get an update_id at the start, and
use the one we got at the start when returning, irrespective of
what other calls into the Channel during that time did" is
relatively straightforward.
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/channelmonitor.rs