]> git.bitcoin.ninja Git - rust-lightning/commit
Support all shutdown scripts defined in BOLT 2
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 26 Jul 2021 16:31:24 +0000 (12:31 -0400)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 9 Aug 2021 20:55:26 +0000 (15:55 -0500)
commitccd11fc35a56b06b93e8102bb6c76a109b7a3309
tree3c810a49eba309037834e8a2fa12f3b6e0a7307b
parent1ab2c7c6680f26cd265ffcf0b5731369530c5659
Support all shutdown scripts defined in BOLT 2

KeysInterface::get_shutdown_pubkey is used to form P2WPKH shutdown
scripts. However, BOLT 2 allows for a wider variety of scripts. Refactor
KeysInterface to allow any supported script while still maintaining
serialization backwards compatibility with P2WPKH script pubkeys stored
simply as the PublicKey.

Add an optional TLV field to Channel and ChannelMonitor to support the
new format, but continue to serialize the legacy PublicKey format.
fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
lightning/src/chain/channelmonitor.rs
lightning/src/chain/keysinterface.rs
lightning/src/ln/channel.rs
lightning/src/ln/script.rs
lightning/src/util/test_utils.rs