From 60f7977ea84b2092531d44abd471a19aac768ea7 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 3 Mar 2022 18:09:46 +0000 Subject: [PATCH] Add Clone to a few structs which contain only a few fields Specifically, `PhantomRouteHints`, `FixedPenaltyScorer`, and `ScoringParamters`. --- lightning/src/ln/channelmanager.rs | 1 + lightning/src/routing/scoring.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 674977fa..d206dee4 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -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, diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index dfda3d2f..537d7501 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -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 { channel_failures: HashMap>, } +#[derive(Clone)] /// Parameters for configuring [`Scorer`]. pub struct ScoringParameters { /// A fixed penalty in msats to apply to each channel. -- 2.30.2