From: Jeffrey Czyz Date: Thu, 20 Jan 2022 17:56:24 +0000 (-0600) Subject: f - Implement Writeable for FixedPenaltyScorer X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=2dea7beed0569fee46d13b98f16a101a0828606c;p=rust-lightning f - Implement Writeable for FixedPenaltyScorer --- 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 }