Add option to accept or reject inbound channels
authorViktor Tigerström <viktortigerstrom@hotmail.com>
Tue, 25 Jan 2022 23:21:22 +0000 (00:21 +0100)
committerViktor Tigerström <viktortigerstrom@hotmail.com>
Sun, 13 Feb 2022 20:04:19 +0000 (21:04 +0100)
commit8dca0b47795db0eeee968d7a03ee0b1595484a52
tree48b569860a50bba7eee1a45eec6998af92cdae9e
parentb8e9e8b83467182a9d66ba10eea5b1ccfaa59410
Add option to accept or reject inbound channels

Add a new config flag `UserConfig::manually_accept_inbound_channels`,
which when set to true allows the node operator to accept or reject new
channel requests.

When set to true, `Event::OpenChannelRequest` will be triggered once a
request to open a new inbound channel is received. When accepting the
request, `ChannelManager::accept_inbound_channel` should be called.
Rejecting the request is done through
`ChannelManager::force_close_channel`.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/util/config.rs
lightning/src/util/events.rs