File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ use crate::sign::{NodeSigner, Recipient};
22
22
use crate :: types:: features:: BlindedHopFeatures ;
23
23
use crate :: types:: payment:: PaymentHash ;
24
24
use crate :: util:: logger:: Logger ;
25
- use crate :: util:: ser:: Writeable ;
26
25
27
26
#[ allow( unused_imports) ]
28
27
use crate :: prelude:: * ;
@@ -80,17 +79,15 @@ fn check_trampoline_onion_constraints(
80
79
trampoline_amount : u64 ,
81
80
) -> Result < ( ) , ( LocalHTLCFailureReason , Vec < u8 > ) > {
82
81
if outer_hop_data. outgoing_cltv_value < trampoline_cltv_value {
83
- let mut err_data = Vec :: new ( ) ;
84
- outer_hop_data. outgoing_cltv_value . write ( & mut err_data) . unwrap ( ) ;
82
+ let err_data = outer_hop_data. outgoing_cltv_value . to_be_bytes ( ) . to_vec ( ) ;
85
83
return Err ( ( LocalHTLCFailureReason :: FinalIncorrectCLTVExpiry , err_data) ) ;
86
84
}
87
85
let outgoing_amount = outer_hop_data
88
86
. multipath_trampoline_data
89
87
. as_ref ( )
90
88
. map_or ( outer_hop_data. amt_to_forward , |mtd| mtd. total_msat ) ;
91
89
if outgoing_amount < trampoline_amount {
92
- let mut err_data = Vec :: new ( ) ;
93
- outgoing_amount. write ( & mut err_data) . unwrap ( ) ;
90
+ let err_data = outgoing_amount. to_be_bytes ( ) . to_vec ( ) ;
94
91
return Err ( ( LocalHTLCFailureReason :: FinalIncorrectHTLCAmount , err_data) ) ;
95
92
}
96
93
You can’t perform that action at this time.
0 commit comments