Skip to content

Commit 9a4d636

Browse files
committed
f - Rename AlwaysPresent to Eternity as the former has two meanings
1 parent e54a49b commit 9a4d636

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lightning/src/routing/scorer.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ pub struct ScoringParameters {
8080
/// [`failure_penalty_half_life`]: Self::failure_penalty_half_life
8181
pub failure_penalty_msat: u64,
8282

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.
8490
pub failure_penalty_half_life: Duration,
8591
}
8692

@@ -194,10 +200,10 @@ impl Clock for std::time::Instant {
194200
}
195201
}
196202

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;
199205

200-
impl Clock for AlwaysPresent {
206+
impl Clock for Eternity {
201207
fn now() -> Self {
202208
Self
203209
}

lightning/src/util/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use ln::features::{ChannelFeatures, InitFeatures};
2121
use ln::msgs;
2222
use ln::msgs::OptionalField;
2323
use ln::script::ShutdownScript;
24-
use routing::scorer::{AlwaysPresent, Scorer};
24+
use routing::scorer::{Eternity, Scorer};
2525
use util::enforcing_trait_impls::{EnforcingSigner, EnforcementState};
2626
use util::events;
2727
use util::logger::{Logger, Level, Record};
@@ -693,4 +693,4 @@ impl core::fmt::Debug for OnRegisterOutput {
693693
}
694694

695695
/// 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>;

0 commit comments

Comments
 (0)