X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannelmonitor.rs;h=ded2a99dc37cf2933150d8537ec31ecfaddc073e;hb=68be3c03531667a1ecae7c67664e0ef71ea98a61;hp=12c26322bf8557fa845d9aa3f482479846b527fe;hpb=e9e27f277a3330cede4fd79f41923b03d3b872ed;p=rust-lightning diff --git a/src/ln/channelmonitor.rs b/src/ln/channelmonitor.rs index 12c26322..ded2a99d 100644 --- a/src/ln/channelmonitor.rs +++ b/src/ln/channelmonitor.rs @@ -63,6 +63,9 @@ pub trait ManyChannelMonitor: Send + Sync { /// If you're using this for local monitoring of your own channels, you probably want to use /// `OutPoint` as the key, which will give you a ManyChannelMonitor implementation. pub struct SimpleManyChannelMonitor { + #[cfg(test)] // Used in ChannelManager tests to manipulate channels directly + pub monitors: Mutex>, + #[cfg(not(test))] monitors: Mutex>, chain_monitor: Arc, broadcaster: Arc @@ -1222,7 +1225,7 @@ impl ChannelMonitor { }; } - let secret = self.get_secret(commitment_number).unwrap(); + let secret = ignore_error!(self.get_secret(commitment_number)); let per_commitment_key = ignore_error!(SecretKey::from_slice(&self.secp_ctx, &secret)); let per_commitment_point = PublicKey::from_secret_key(&self.secp_ctx, &per_commitment_key); let revocation_pubkey = match self.key_storage { @@ -1269,7 +1272,6 @@ impl ChannelMonitor { output: outputs, }; - let sighash_parts = bip143::SighashComponents::new(&spend_tx); let sig = match self.key_storage {