@@ -2156,7 +2156,8 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
21562156					return  PendingHTLCStatus :: Fail ( HTLCFailureMsg :: Relay ( msgs:: UpdateFailHTLC  { 
21572157						channel_id:  msg. channel_id, 
21582158						htlc_id:  msg. htlc_id, 
2159- 						reason:  onion_utils:: build_first_hop_failure_packet( & shared_secret,  $err_code,  $data) , 
2159+ 						reason:  HTLCFailReason :: reason( $err_code,  $data. to_vec( ) ) 
2160+ 							. get_encrypted_failure_packet( & shared_secret,  & None ) , 
21602161					} ) ) ; 
21612162				} 
21622163			} 
@@ -5013,10 +5014,10 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
50135014						PendingHTLCStatus :: Forward ( PendingHTLCInfo  {  ref  incoming_shared_secret,  .. } )  => { 
50145015							let  reason = if  ( error_code &  0x1000 )  != 0  { 
50155016								let  ( real_code,  error_data)  = self . get_htlc_inbound_temp_fail_err_and_data ( error_code,  chan) ; 
5016- 								onion_utils :: build_first_hop_failure_packet ( incoming_shared_secret ,   real_code,  & error_data) 
5017+ 								HTLCFailReason :: reason ( real_code,  error_data) 
50175018							}  else  { 
5018- 								onion_utils :: build_first_hop_failure_packet ( incoming_shared_secret ,   error_code,   & [ ] ) 
5019- 							} ; 
5019+ 								HTLCFailReason :: from_failure_code ( error_code) 
5020+ 							} . get_encrypted_failure_packet ( incoming_shared_secret ,   & None ) ; 
50205021							let  msg = msgs:: UpdateFailHTLC  { 
50215022								channel_id :  msg. channel_id , 
50225023								htlc_id :  msg. htlc_id , 
0 commit comments