@@ -120,6 +120,12 @@ pub trait ScoreUpdate {
120120
121121 /// Handles updating channel penalties after a probe over the given path succeeded.
122122 fn probe_successful( & mut self , path: & Path , duration_since_epoch: Duration ) ;
123+
124+ /// Scorers may wich to reduce their certainty of channel liquidity information over time.
125+ /// Thus, this method is provided to allow scorers to observe the passage of time - the holder
126+ /// of this object should call this method regularly (generally via the
127+ /// `lightning-background-processor` trait).
128+ fn decay_liquidity_certainty( & mut self , duration_since_epoch: Duration ) ;
123129}
124130
125131/// A trait which can both lookup and update routing channel penalty scores.
@@ -160,6 +166,10 @@ impl<S: ScoreUpdate, T: DerefMut<Target=S>> ScoreUpdate for T {
160166 fn probe_successful( & mut self , path: & Path , duration_since_epoch: Duration ) {
161167 self . deref_mut( ) . probe_successful( path, duration_since_epoch)
162168 }
169+
170+ fn decay_liquidity_certainty( & mut self , duration_since_epoch: Duration ) {
171+ self . deref_mut( ) . decay_liquidity_certainty( duration_since_epoch)
172+ }
163173}
164174} }
165175
@@ -362,6 +372,10 @@ impl<'a, T: Score> ScoreUpdate for MultiThreadedScoreLockWrite<'a, T> {
362372 fn probe_successful ( & mut self , path : & Path , duration_since_epoch : Duration ) {
363373 self . 0 . probe_successful ( path, duration_since_epoch)
364374 }
375+
376+ fn decay_liquidity_certainty ( & mut self , duration_since_epoch : Duration ) {
377+ self . 0 . decay_liquidity_certainty ( duration_since_epoch)
378+ }
365379}
366380
367381
@@ -407,6 +421,8 @@ impl ScoreUpdate for FixedPenaltyScorer {
407421 fn probe_failed ( & mut self , _path : & Path , _short_channel_id : u64 , _duration_since_epoch : Duration ) { }
408422
409423 fn probe_successful ( & mut self , _path : & Path , _duration_since_epoch : Duration ) { }
424+
425+ fn decay_liquidity_certainty ( & mut self , _duration_since_epoch : Duration ) { }
410426}
411427
412428impl Writeable for FixedPenaltyScorer {
@@ -1457,6 +1473,8 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ScoreUpdate for Prob
14571473 fn probe_successful ( & mut self , path : & Path , duration_since_epoch : Duration ) {
14581474 self . payment_path_failed ( path, u64:: max_value ( ) , duration_since_epoch)
14591475 }
1476+
1477+ fn decay_liquidity_certainty ( & mut self , _duration_since_epoch : Duration ) { }
14601478}
14611479
14621480#[ cfg( c_bindings) ]
0 commit comments