@@ -282,13 +282,6 @@ impl_writeable!(ChannelInfo, 0, {
282
282
minimum_fee_penalty
283
283
} ) ;
284
284
285
- /// By default, these methods do nothing. A user may override them to write to their metadata as needed
286
- impl ChannelScorer for ChannelInfo {
287
- fn calculate_minimum_fee_penalty ( & self , _channel_id : u64 ) { }
288
- fn score_payment_failure ( & self , _route : Vec < Vec < RouteHop > > , _faulty_nodes : Vec < PublicKey > ) { }
289
- fn score_payment_success ( & self , _route : Vec < Vec < RouteHop > > ) { }
290
- }
291
-
292
285
/// Fees for routing via a given channel or a node
293
286
#[ derive( Eq , PartialEq , Copy , Clone , Debug ) ]
294
287
pub struct RoutingFees {
@@ -443,11 +436,11 @@ impl Readable for NodeInfo {
443
436
/// route-finding algorithm.
444
437
pub trait ChannelScorer {
445
438
/// Returns penalty fee for a given channel ID based on user's channel metadata
446
- fn calculate_minimum_fee_penalty ( & self , channel_id : u64 ) ;
439
+ fn calculate_minimum_fee_penalty ( & self , _channel_id : u64 ) { }
447
440
/// Optional: allows user to count PaymentSent events for channels
448
- fn score_payment_success ( & self , route : Vec < Vec < RouteHop > > ) ;
441
+ fn score_payment_success ( & self , _route : Vec < Vec < RouteHop > > ) { }
449
442
/// Optional: allows user to count PaymentFailed events for channels
450
- fn score_payment_failure ( & self , route : Vec < Vec < RouteHop > > , faulty_nodes : Vec < PublicKey > ) ;
443
+ fn score_payment_failure ( & self , _route : Vec < Vec < RouteHop > > , _faulty_nodes : Vec < PublicKey > ) { }
451
444
}
452
445
453
446
/// Represents the network as nodes and channels between them
@@ -510,11 +503,7 @@ impl std::fmt::Display for NetworkGraph {
510
503
}
511
504
}
512
505
513
- impl ChannelScorer for NetworkGraph {
514
- fn calculate_minimum_fee_penalty ( & self , _channel_id : u64 ) { }
515
- fn score_payment_success ( & self , _route : Vec < Vec < RouteHop > > ) { }
516
- fn score_payment_failure ( & self , _route : Vec < Vec < RouteHop > > , _faulty_nodes : Vec < PublicKey > ) { }
517
- }
506
+ impl ChannelScorer for NetworkGraph { }
518
507
519
508
impl NetworkGraph {
520
509
/// Returns all known valid channels' short ids along with announced channel info.
0 commit comments