+/// [`Score`] implementation that uses a fixed penalty.
+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 {
+ Self { penalty_msat }
+ }
+}
+
+impl Score for FixedPenaltyScorer {
+ fn channel_penalty_msat(&self, _: u64, _: u64, _: u64, _: &NodeId, _: &NodeId) -> u64 {
+ self.penalty_msat
+ }
+
+ fn payment_path_failed(&mut self, _path: &[&RouteHop], _short_channel_id: u64) {}
+
+ fn payment_path_successful(&mut self, _path: &[&RouteHop]) {}
+}
+