+ match self.key_storage {
+ Storage::Local { ref payment_base_key, .. } => {
+ if let Ok(payment_key) = chan_utils::derive_public_key(&self.secp_ctx, &their_revocation_point, &PublicKey::from_secret_key(&self.secp_ctx, &payment_base_key)) {
+ let to_remote_script = Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0)
+ .push_slice(&Hash160::hash(&payment_key.serialize())[..])
+ .into_script();
+ if let Ok(to_remote_key) = chan_utils::derive_private_key(&self.secp_ctx, &their_revocation_point, &payment_base_key) {
+ self.to_remote_rescue = Some((to_remote_script, to_remote_key));
+ }
+ }
+ },
+ Storage::Watchtower { .. } => {}
+ }