From 2dea7beed0569fee46d13b98f16a101a0828606c Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 20 Jan 2022 11:56:24 -0600 Subject: [PATCH] f - Implement Writeable for FixedPenaltyScorer --- lightning/src/routing/scoring.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index acac35ab3..bb41f3735 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -195,6 +195,10 @@ pub struct FixedPenaltyScorer { penalty_msat: u64, } +impl_writeable_tlv_based!(FixedPenaltyScorer, { + (0, penalty_msat, required), +}); + impl FixedPenaltyScorer { /// Creates a new scorer using `penalty_msat`. pub fn with_penalty(penalty_msat: u64) -> Self { @@ -203,7 +207,7 @@ impl FixedPenaltyScorer { } impl Score for FixedPenaltyScorer { - fn channel_penalty_msat( &self, _: u64, _: u64, _: u64, _: &NodeId, _: &NodeId) -> u64 { + fn channel_penalty_msat(&self, _: u64, _: u64, _: u64, _: &NodeId, _: &NodeId) -> u64 { self.penalty_msat } -- 2.39.5