@@ -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
@@ -361,6 +371,10 @@ impl<'a, T: Score> ScoreUpdate for MultiThreadedScoreLockWrite<'a, T> {
361371 fn probe_successful ( & mut self , path : & Path , duration_since_epoch : Duration ) {
362372 self . 0 . probe_successful ( path, duration_since_epoch)
363373 }
374+
375+ fn decay_liquidity_certainty ( & mut self , duration_since_epoch : Duration ) {
376+ self . 0 . decay_liquidity_certainty ( duration_since_epoch)
377+ }
364378}
365379
366380
@@ -406,6 +420,8 @@ impl ScoreUpdate for FixedPenaltyScorer {
406420 fn probe_failed ( & mut self , _path : & Path , _short_channel_id : u64 , _duration_since_epoch : Duration ) { }
407421
408422 fn probe_successful ( & mut self , _path : & Path , _duration_since_epoch : Duration ) { }
423+
424+ fn decay_liquidity_certainty ( & mut self , _duration_since_epoch : Duration ) { }
409425}
410426
411427impl Writeable for FixedPenaltyScorer {
@@ -1463,6 +1479,8 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> ScoreUpdate for Prob
14631479 fn probe_successful ( & mut self , path : & Path , duration_since_epoch : Duration ) {
14641480 self . payment_path_failed ( path, u64:: max_value ( ) , duration_since_epoch)
14651481 }
1482+
1483+ fn decay_liquidity_certainty ( & mut self , _duration_since_epoch : Duration ) { }
14661484}
14671485
14681486#[ cfg( c_bindings) ]
0 commit comments