From: Matt Corallo Date: Thu, 3 Mar 2022 18:09:46 +0000 (+0000) Subject: Add Clone to a few structs which contain only a few fields X-Git-Tag: v0.0.106~34^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2022-03-clones;p=rust-lightning Add Clone to a few structs which contain only a few fields Specifically, `PhantomRouteHints`, `FixedPenaltyScorer`, and `ScoringParamters`. --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 674977faa..d206dee49 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 dfda3d2f8..537d75012 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.