@@ -53,7 +53,7 @@ use crate::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringFeeParame
53
53
use crate::ln::onion_payment::{check_incoming_htlc_cltv, create_recv_pending_htlc_info, create_fwd_pending_htlc_info, decode_incoming_update_add_htlc_onion, InboundOnionErr, NextPacketDetails};
54
54
use crate::ln::msgs;
55
55
use crate::ln::onion_utils;
56
- use crate::ln::onion_utils::HTLCFailReason;
56
+ use crate::ln::onion_utils::{ HTLCFailReason, INVALID_ONION_BLINDING} ;
57
57
use crate::ln::msgs::{ChannelMessageHandler, DecodeError, LightningError};
58
58
#[cfg(test)]
59
59
use crate::ln::outbound_payment;
@@ -2977,14 +2977,24 @@ where
2977
2977
msg, &self.node_signer, &self.logger, &self.secp_ctx
2978
2978
)?;
2979
2979
2980
+ let is_blinded = match next_hop {
2981
+ onion_utils::Hop::Forward {
2982
+ next_hop_data: msgs::InboundOnionPayload::BlindedForward { .. }, ..
2983
+ } => true,
2984
+ _ => false, // TODO: update this when we support receiving to multi-hop blinded paths
2985
+ };
2986
+
2980
2987
macro_rules! return_err {
2981
2988
($msg: expr, $err_code: expr, $data: expr) => {
2982
2989
{
2983
2990
log_info!(self.logger, "Failed to accept/forward incoming HTLC: {}", $msg);
2991
+ let (err_code, err_data) = if is_blinded {
2992
+ (INVALID_ONION_BLINDING, &[0; 32][..])
2993
+ } else { ($err_code, $data) };
2984
2994
return Err(HTLCFailureMsg::Relay(msgs::UpdateFailHTLC {
2985
2995
channel_id: msg.channel_id,
2986
2996
htlc_id: msg.htlc_id,
2987
- reason: HTLCFailReason::reason($ err_code, $data .to_vec())
2997
+ reason: HTLCFailReason::reason(err_code, err_data .to_vec())
2988
2998
.get_encrypted_failure_packet(&shared_secret, &None),
2989
2999
}));
2990
3000
}
0 commit comments