Description
When the channel manager has been configured to "manually accept" incoming channels, the OpenChannelRequest
event is sent to the event handler. Besides giving the user an opportunity to accept or reject the channel, it additionally allows the user to assign their own identity to a channel via the user_channel_id
. This is also presumably a reasonable place for user code to create any internal structures that it needs that are related to the channel.
Currently, handler for the open_channel
Lightning protocol message unilaterally creates the IncomingV1Channel
object using a randomly generated user_channel_id
: in particular, it does this /before/ sending the OpenChannelRequest
. This has the side effect of immediately requesting cryptographic material via the Signer interfaces using the randomly generated user_channel_id
(e.g., when calling SignerProvider::generate_channel_keys_id
).
It seems like it might make sense to instead defer creation of the IncomingV1Channel object until after user code has accepted the channel and provided an identity for it. See for example #2428 for one possible approach.