]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f - Implement Writeable for FixedPenaltyScorer
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 20 Jan 2022 17:56:24 +0000 (11:56 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Thu, 20 Jan 2022 22:17:30 +0000 (16:17 -0600)
lightning/src/routing/scoring.rs

index acac35ab3359aa3f6e13f73a4a915ab695f0c5d3..bb41f373570f1f9b703333647a4590b84af8ed13 100644 (file)
@@ -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
        }