Merge pull request #2680 from TheBlueMatt/2023-10-0.0.118-bindings
[rust-lightning] / lightning / src / ln / channelmanager.rs
index c4efd895796e67d1f3c1ecc46e5559b277c5cc9b..024e1d04c53e928d97308ea75288275952dbb9d6 100644 (file)
@@ -86,7 +86,7 @@ use core::time::Duration;
 use core::ops::Deref;
 
 // Re-export this for use in the public API.
-pub use crate::ln::outbound_payment::{PaymentSendFailure, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields};
+pub(crate) use crate::ln::outbound_payment::{PaymentSendFailure, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields};
 use crate::ln::script::ShutdownScript;
 
 // We hold various information about HTLC relay in the HTLC objects in Channel itself:
@@ -840,8 +840,6 @@ pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
                Arc<NetworkGraph<Arc<L>>>,
                Arc<L>,
                Arc<RwLock<ProbabilisticScorer<Arc<NetworkGraph<Arc<L>>>, Arc<L>>>>,
-               ProbabilisticScoringFeeParameters,
-               ProbabilisticScorer<Arc<NetworkGraph<Arc<L>>>, Arc<L>>,
        >>,
        Arc<L>
 >;
@@ -870,8 +868,6 @@ pub type SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, M, T, F, L> =
                        &'f NetworkGraph<&'g L>,
                        &'g L,
                        &'h RwLock<ProbabilisticScorer<&'f NetworkGraph<&'g L>, &'g L>>,
-                       ProbabilisticScoringFeeParameters,
-                       ProbabilisticScorer<&'f NetworkGraph<&'g L>, &'g L>
                >,
                &'g L
        >;
@@ -3389,7 +3385,7 @@ where
                // If we returned an error and the `node_signer` cannot provide a signature for whatever
                // reason`, we wouldn't be able to receive inbound payments through the corresponding
                // channel.
-               let sig = self.node_signer.sign_gossip_message(msgs::UnsignedGossipMessage::ChannelUpdate(&unsigned)).unwrap();
+               let sig = self.node_signer.sign_gossip_message(msgs::UnsignedGossipMessage::ChannelUpdate(unsigned.clone())).unwrap();
 
                Ok(msgs::ChannelUpdate {
                        signature: sig,
@@ -4049,7 +4045,7 @@ where
        /// [`ChannelUnavailable`]: APIError::ChannelUnavailable
        /// [`APIMisuseError`]: APIError::APIMisuseError
        pub fn update_partial_channel_config(
-               &self, counterparty_node_id: &PublicKey, channel_ids: &[ChannelId], config_update: &ChannelConfigUpdate,
+               &self, counterparty_node_id: &PublicKey, channel_ids: Vec<ChannelId>, config_update: &ChannelConfigUpdate,
        ) -> Result<(), APIError> {
                if config_update.cltv_expiry_delta.map(|delta| delta < MIN_CLTV_EXPIRY_DELTA).unwrap_or(false) {
                        return Err(APIError::APIMisuseError {
@@ -4063,14 +4059,14 @@ where
                        .ok_or_else(|| APIError::ChannelUnavailable { err: format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id) })?;
                let mut peer_state_lock = peer_state_mutex.lock().unwrap();
                let peer_state = &mut *peer_state_lock;
-               for channel_id in channel_ids {
+               for channel_id in channel_ids.iter() {
                        if !peer_state.has_channel(channel_id) {
                                return Err(APIError::ChannelUnavailable {
                                        err: format!("Channel with id {} not found for the passed counterparty node_id {}", channel_id, counterparty_node_id),
                                });
                        };
                }
-               for channel_id in channel_ids {
+               for channel_id in channel_ids.iter() {
                        if let Some(channel_phase) = peer_state.channel_by_id.get_mut(channel_id) {
                                let mut config = channel_phase.context().config();
                                config.apply(config_update);
@@ -4124,7 +4120,7 @@ where
        /// [`ChannelUnavailable`]: APIError::ChannelUnavailable
        /// [`APIMisuseError`]: APIError::APIMisuseError
        pub fn update_channel_config(
-               &self, counterparty_node_id: &PublicKey, channel_ids: &[ChannelId], config: &ChannelConfig,
+               &self, counterparty_node_id: &PublicKey, channel_ids: Vec<ChannelId>, config: &ChannelConfig,
        ) -> Result<(), APIError> {
                return self.update_partial_channel_config(counterparty_node_id, channel_ids, &(*config).into());
        }