Generate shutdown script at channel close
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 26 Jul 2021 18:04:44 +0000 (14:04 -0400)
committerJeffrey Czyz <jkczyz@gmail.com>
Sat, 31 Jul 2021 05:13:35 +0000 (00:13 -0500)
commit1e922aeb0c0ad63af46f98b85c733df576009802
tree221c73e9be922666908a5232b7f2c0ca6b5f05aa
parent943934ab214ed9ae21ee38fedaecfa3a1d516883
Generate shutdown script at channel close

When a shutdown script is omitted from open_channel or accept_channel,
it must be provided when sending shutdown. Generate the shutdown script
at channel closing time in this case rather at channel opening.

This requires producing a ChannelMonitorUpdate with the shutdown script
since it is no longer known at ChannelMonitor creation.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs