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};
2222use crate :: types:: features:: BlindedHopFeatures ;
2323use crate :: types:: payment:: PaymentHash ;
2424use crate :: util:: logger:: Logger ;
25- use crate :: util:: ser:: Writeable ;
2625
2726#[ allow( unused_imports) ]
2827use crate :: prelude:: * ;
@@ -80,17 +79,15 @@ fn check_trampoline_onion_constraints(
8079 trampoline_amount : u64 ,
8180) -> Result < ( ) , ( LocalHTLCFailureReason , Vec < u8 > ) > {
8281 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 ( ) ;
8583 return Err ( ( LocalHTLCFailureReason :: FinalIncorrectCLTVExpiry , err_data) ) ;
8684 }
8785 let outgoing_amount = outer_hop_data
8886 . multipath_trampoline_data
8987 . as_ref ( )
9088 . map_or ( outer_hop_data. amt_to_forward , |mtd| mtd. total_msat ) ;
9189 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 ( ) ;
9491 return Err ( ( LocalHTLCFailureReason :: FinalIncorrectHTLCAmount , err_data) ) ;
9592 }
9693
You can’t perform that action at this time.
0 commit comments