From 6caed7df7cf21de837d4b31443699a933164b9cd Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 8 Feb 2020 17:45:40 -0500 Subject: [PATCH] Create ChannelMonitors with basic_channel_info and funding_info set This removes most of the reliance on ChannelMonitor Clone, creating them in Channel only at the time when we need to start monitoring the chain. --- lightning/src/ln/channel.rs | 109 +++++++++++++++++------------ lightning/src/ln/channelmonitor.rs | 78 +++++++++------------ 2 files changed, 97 insertions(+), 90 deletions(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 3cc845362..d0db1d856 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -247,6 +247,7 @@ pub(super) struct Channel { #[cfg(test)] pub(super) local_keys: ChanSigner, shutdown_pubkey: PublicKey, + destination_script: Script, // Our commitment numbers start at 2^48-1 and count down, whereas the ones used in transaction // generation start at 0 and count up...this simplifies some parts of implementation at the @@ -351,7 +352,9 @@ pub(super) struct Channel { their_shutdown_scriptpubkey: Option