@@ -2156,7 +2156,8 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
2156
2156
return PendingHTLCStatus :: Fail ( HTLCFailureMsg :: Relay ( msgs:: UpdateFailHTLC {
2157
2157
channel_id: msg. channel_id,
2158
2158
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 ) ,
2160
2161
} ) ) ;
2161
2162
}
2162
2163
}
@@ -5013,10 +5014,10 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
5013
5014
PendingHTLCStatus :: Forward ( PendingHTLCInfo { ref incoming_shared_secret, .. } ) => {
5014
5015
let reason = if ( error_code & 0x1000 ) != 0 {
5015
5016
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)
5017
5018
} 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 ) ;
5020
5021
let msg = msgs:: UpdateFailHTLC {
5021
5022
channel_id : msg. channel_id ,
5022
5023
htlc_id : msg. htlc_id ,
0 commit comments