Lock outbound channels at 0conf if the peer indicates support for it
authorMatt Corallo <git@bluematt.me>
Tue, 1 Feb 2022 21:57:01 +0000 (21:57 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 27 May 2022 22:40:07 +0000 (22:40 +0000)
commit35cd39da15f9bf8d55cb3249c6d32cd7756cd21f
tree25c0c65a0e9920bf5ea6b7e632ed5b3bc7143df8
parent168b3a51ae024e3abf73112c2acf9f60523c5674
Lock outbound channels at 0conf if the peer indicates support for it

If our peer sets a minimum depth of 0, and we're set to trusting
ourselves to not double-spend our own funding transactions, send a
funding_locked message immediately after funding signed.

Note that some special care has to be taken around the
`channel_state` values - `ChannelFunded` no longer implies the
funding transaction is confirmed on-chain. Thus, for example, the
should-we-re-broadcast logic has to now accept `channel_state`
values greater than `ChannelFunded` as indicating we may still need
to re-broadcast our funding tranasction, unless `minimum_depth` is
greater than 0.

Further note that this starts writing `Channel` objects with a
`MIN_SERIALIZATION_VERSION` of 2. Thus, LDK versions prior to
0.0.99 (July 2021) will now refuse to read serialized
Channels/ChannelManagers.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/priv_short_conf_tests.rs
lightning/src/util/config.rs