File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -127,14 +127,14 @@ impl ChannelFailure {
127
127
}
128
128
129
129
fn add_penalty ( & mut self , failure_penalty_msat : u64 , half_life : Duration ) {
130
- self . undecayed_penalty_msat = self . decayed_penalty ( half_life) + failure_penalty_msat;
130
+ self . undecayed_penalty_msat = self . decayed_penalty_msat ( half_life) + failure_penalty_msat;
131
131
#[ cfg( not( feature = "no-std" ) ) ]
132
132
{
133
133
self . last_failed = Instant :: now ( ) ;
134
134
}
135
135
}
136
136
137
- fn decayed_penalty ( & self , half_life : Duration ) -> u64 {
137
+ fn decayed_penalty_msat ( & self , half_life : Duration ) -> u64 {
138
138
let decays = self . elapsed ( ) . as_secs ( ) . checked_div ( half_life. as_secs ( ) ) ;
139
139
match decays {
140
140
Some ( decays) => self . undecayed_penalty_msat >> decays,
@@ -172,7 +172,7 @@ impl routing::Score for Scorer {
172
172
) -> u64 {
173
173
let failure_penalty_msat = self . channel_failures
174
174
. get ( & short_channel_id)
175
- . map_or ( 0 , |failure| failure . decayed_penalty ( self . params . failure_penalty_half_life ) ) ;
175
+ . map_or ( 0 , |value| value . decayed_penalty_msat ( self . params . failure_penalty_half_life ) ) ;
176
176
177
177
self . params . base_penalty_msat + failure_penalty_msat
178
178
}
You can’t perform that action at this time.
0 commit comments