File tree 1 file changed +16
-4
lines changed
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -197,10 +197,6 @@ pub struct FixedPenaltyScorer {
197
197
penalty_msat : u64 ,
198
198
}
199
199
200
- impl_writeable_tlv_based ! ( FixedPenaltyScorer , {
201
- ( 0 , penalty_msat, required) ,
202
- } ) ;
203
-
204
200
impl FixedPenaltyScorer {
205
201
/// Creates a new scorer using `penalty_msat`.
206
202
pub fn with_penalty ( penalty_msat : u64 ) -> Self {
@@ -218,6 +214,22 @@ impl Score for FixedPenaltyScorer {
218
214
fn payment_path_successful ( & mut self , _path : & [ & RouteHop ] ) { }
219
215
}
220
216
217
+ impl Writeable for FixedPenaltyScorer {
218
+ #[ inline]
219
+ fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
220
+ write_tlv_fields ! ( w, { } ) ;
221
+ Ok ( ( ) )
222
+ }
223
+ }
224
+
225
+ impl ReadableArgs < u64 > for FixedPenaltyScorer {
226
+ #[ inline]
227
+ fn read < R : Read > ( r : & mut R , penalty_msat : u64 ) -> Result < Self , DecodeError > {
228
+ read_tlv_fields ! ( r, { } ) ;
229
+ Ok ( Self { penalty_msat } )
230
+ }
231
+ }
232
+
221
233
/// [`Score`] implementation that provides reasonable default behavior.
222
234
///
223
235
/// Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
You can’t perform that action at this time.
0 commit comments