]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add Clone to a few structs which contain only a few fields 2022-03-clones
authorMatt Corallo <git@bluematt.me>
Thu, 3 Mar 2022 18:09:46 +0000 (18:09 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 3 Mar 2022 18:10:59 +0000 (18:10 +0000)
Specifically, `PhantomRouteHints`, `FixedPenaltyScorer`, and
`ScoringParamters`.

lightning/src/ln/channelmanager.rs
lightning/src/routing/scoring.rs

index 674977faaebc2ecd519682ea8f5edb17589fc81b..d206dee4950f3f9908e0cbdd8af6755d485de2a2 100644 (file)
@@ -1322,6 +1322,7 @@ pub enum PaymentSendFailure {
 /// Route hints used in constructing invoices for [phantom node payents].
 ///
 /// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
+#[derive(Clone)]
 pub struct PhantomRouteHints {
        /// The list of channels to be included in the invoice route hints.
        pub channels: Vec<ChannelDetails>,
index dfda3d2f867d189c7f36de9b45072c01bed98816..537d75012abc88b9233d403c03aac469b2cf77e4 100644 (file)
@@ -189,6 +189,7 @@ impl<'a, S: Writeable> Writeable for MutexGuard<'a, S> {
        }
 }
 
+#[derive(Clone)]
 /// [`Score`] implementation that uses a fixed penalty.
 pub struct FixedPenaltyScorer {
        penalty_msat: u64,
@@ -252,6 +253,7 @@ pub struct ScorerUsingTime<T: Time> {
        channel_failures: HashMap<u64, ChannelFailure<T>>,
 }
 
+#[derive(Clone)]
 /// Parameters for configuring [`Scorer`].
 pub struct ScoringParameters {
        /// A fixed penalty in msats to apply to each channel.