File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,13 @@ pub struct ScoringParameters {
80
80
/// [`failure_penalty_half_life`]: Self::failure_penalty_half_life
81
81
pub failure_penalty_msat : u64 ,
82
82
83
- /// The time needed before any accumulated channel failure penalties are cut in half.
83
+ /// The time required to elapse before any accumulated channel failure penalties are cut in
84
+ /// half.
85
+ ///
86
+ /// # Note
87
+ ///
88
+ /// When time is an [`Eternity`], as is default when enabling feature `no-std`, it will never
89
+ /// elapse. Therefore, this penalty will never decay.
84
90
pub failure_penalty_half_life : Duration ,
85
91
}
86
92
@@ -194,10 +200,10 @@ impl Clock for std::time::Instant {
194
200
}
195
201
}
196
202
197
- /// A clock that is always present, now or after time has passed .
198
- pub struct AlwaysPresent ;
203
+ /// A state in which time has no meaning .
204
+ pub struct Eternity ;
199
205
200
- impl Clock for AlwaysPresent {
206
+ impl Clock for Eternity {
201
207
fn now ( ) -> Self {
202
208
Self
203
209
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use ln::features::{ChannelFeatures, InitFeatures};
21
21
use ln:: msgs;
22
22
use ln:: msgs:: OptionalField ;
23
23
use ln:: script:: ShutdownScript ;
24
- use routing:: scorer:: { AlwaysPresent , Scorer } ;
24
+ use routing:: scorer:: { Eternity , Scorer } ;
25
25
use util:: enforcing_trait_impls:: { EnforcingSigner , EnforcementState } ;
26
26
use util:: events;
27
27
use util:: logger:: { Logger , Level , Record } ;
@@ -693,4 +693,4 @@ impl core::fmt::Debug for OnRegisterOutput {
693
693
}
694
694
695
695
/// A scorer useful in testing, when the passage of time isn't a concern.
696
- pub type TestScorer = Scorer < AlwaysPresent > ;
696
+ pub type TestScorer = Scorer < Eternity > ;
You can’t perform that action at this time.
0 commit comments