rust-lightning/lightning/src
Chris Waterson 01847277b9 Wait to create a channel until after accepting.
Create a new table in 'peer_state' to maintain unaccepted inbound
channels; i.e., a channel for which we've received an 'open_channel'
message but that user code has not yet confirmed for acceptance. When
user code accepts the channel (e.g. via 'accept_inbound_channel'),
create the channel object and as before.

Currently, the 'open_channel' message eagerly creates an
InboundV1Channel object before determining if the channel should be
accepted. Because this happens /before/ the channel has been assigned
a user identity (which happens in the handler for OpenChannelRequest),
the channel is assigned a random user identity. As part of the
creation process, the channel's cryptographic material is initialized,
which then uses this randomly generated value for the user's channel
identity e.g. in SignerProvider::generate_channel_keys_id.

By delaying the creation of the InboundV1Channel until /after/ the
channel has been accepted, we ensure that we defer cryptographic
initialization until we have given the user the opportunity to assign
an identity to the channel.
2023-08-13 19:40:17 -07:00
..
blinded_path Fuzz test blinded payment pathfinding 2023-07-25 16:32:33 -07:00
chain Add test coverage ChannelClosed event fields 2023-08-08 14:07:16 +03:00
events Wait to create a channel until after accepting. 2023-08-13 19:40:17 -07:00
ln Wait to create a channel until after accepting. 2023-08-13 19:40:17 -07:00
offers Make OffersMessage and offers errors Cloneable 2023-07-20 21:43:52 +00:00
onion_message Make OffersMessage and offers errors Cloneable 2023-07-20 21:43:52 +00:00
routing Merge pull request #1789 from jkczyz/2022-10-scorer-decay 2023-08-09 16:34:33 +00:00
sign Tweak PSBT signing for bindings compatibility 2023-07-20 21:43:52 +00:00
sync Merge pull request #2167 from TheBlueMatt/2023-04-monitor-e-monitor-prep 2023-05-31 22:48:34 +00:00
util De/serialize custom TLVs on {Inbound,Outbound}OnionPayload 2023-08-08 16:13:19 -05:00
lib.rs Ensure we build if a downstream crate sets --cfg=fuzzing 2023-06-20 23:22:15 +00:00