@@ -133,6 +133,7 @@ pub trait Score : ScoreLookUp + ScoreUpdate $(+ $supertrait)* {}
133
133
#[ cfg( not( c_bindings) ) ]
134
134
impl <T : ScoreLookUp + ScoreUpdate $( + $supertrait) * > Score for T { }
135
135
136
+ #[ cfg( not( c_bindings) ) ]
136
137
impl <S : ScoreLookUp , T : Deref <Target =S >> ScoreLookUp for T {
137
138
type ScoreParams = S :: ScoreParams ;
138
139
fn channel_penalty_msat(
@@ -142,6 +143,7 @@ impl<S: ScoreLookUp, T: Deref<Target=S>> ScoreLookUp for T {
142
143
}
143
144
}
144
145
146
+ #[ cfg( not( c_bindings) ) ]
145
147
impl <S : ScoreUpdate , T : DerefMut <Target =S >> ScoreUpdate for T {
146
148
fn payment_path_failed( & mut self , path: & Path , short_channel_id: u64 ) {
147
149
self . deref_mut( ) . payment_path_failed( path, short_channel_id)
@@ -310,6 +312,16 @@ impl<'a, T: 'a + Score> Deref for MultiThreadedScoreLockRead<'a, T> {
310
312
}
311
313
}
312
314
315
+ #[ cfg( c_bindings) ]
316
+ impl < ' a , T : Score > ScoreLookUp for MultiThreadedScoreLockRead < ' a , T > {
317
+ type ScoreParams = T :: ScoreParams ;
318
+ fn channel_penalty_msat ( & self , short_channel_id : u64 , source : & NodeId ,
319
+ target : & NodeId , usage : ChannelUsage , score_params : & Self :: ScoreParams
320
+ ) -> u64 {
321
+ self . 0 . channel_penalty_msat ( short_channel_id, source, target, usage, score_params)
322
+ }
323
+ }
324
+
313
325
#[ cfg( c_bindings) ]
314
326
impl < ' a , T : Score > Writeable for MultiThreadedScoreLockWrite < ' a , T > {
315
327
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , io:: Error > {
@@ -333,6 +345,25 @@ impl<'a, T: 'a + Score> DerefMut for MultiThreadedScoreLockWrite<'a, T> {
333
345
}
334
346
}
335
347
348
+ #[ cfg( c_bindings) ]
349
+ impl < ' a , T : Score > ScoreUpdate for MultiThreadedScoreLockWrite < ' a , T > {
350
+ fn payment_path_failed ( & mut self , path : & Path , short_channel_id : u64 ) {
351
+ self . 0 . payment_path_failed ( path, short_channel_id)
352
+ }
353
+
354
+ fn payment_path_successful ( & mut self , path : & Path ) {
355
+ self . 0 . payment_path_successful ( path)
356
+ }
357
+
358
+ fn probe_failed ( & mut self , path : & Path , short_channel_id : u64 ) {
359
+ self . 0 . probe_failed ( path, short_channel_id)
360
+ }
361
+
362
+ fn probe_successful ( & mut self , path : & Path ) {
363
+ self . 0 . probe_successful ( path)
364
+ }
365
+ }
366
+
336
367
337
368
/// Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
338
369
#[ derive( Clone , Copy , Debug , PartialEq ) ]
0 commit comments