@@ -6603,23 +6603,24 @@ where
6603
6603
Err(e) => PendingHTLCStatus::Fail(e)
6604
6604
};
6605
6605
let create_pending_htlc_status = |chan: &Channel<SP>, pending_forward_info: PendingHTLCStatus, error_code: u16| {
6606
+ if msg.blinding_point.is_some() {
6607
+ return PendingHTLCStatus::Fail(HTLCFailureMsg::Malformed(
6608
+ msgs::UpdateFailMalformedHTLC {
6609
+ channel_id: msg.channel_id,
6610
+ htlc_id: msg.htlc_id,
6611
+ sha256_of_onion: [0; 32],
6612
+ failure_code: INVALID_ONION_BLINDING,
6613
+ }
6614
+ ))
6615
+ }
6606
6616
// If the update_add is completely bogus, the call will Err and we will close,
6607
6617
// but if we've sent a shutdown and they haven't acknowledged it yet, we just
6608
6618
// want to reject the new HTLC and fail it backwards instead of forwarding.
6609
6619
match pending_forward_info {
6610
6620
PendingHTLCStatus::Forward(PendingHTLCInfo {
6611
6621
ref incoming_shared_secret, ref routing, ..
6612
6622
}) => {
6613
- let reason = if msg.blinding_point.is_some() {
6614
- return PendingHTLCStatus::Fail(HTLCFailureMsg::Malformed(
6615
- msgs::UpdateFailMalformedHTLC {
6616
- channel_id: msg.channel_id,
6617
- htlc_id: msg.htlc_id,
6618
- sha256_of_onion: [0; 32],
6619
- failure_code: INVALID_ONION_BLINDING,
6620
- }
6621
- ))
6622
- } else if routing.blinded_failure().is_some() {
6623
+ let reason = if routing.blinded_failure().is_some() {
6623
6624
HTLCFailReason::reason(INVALID_ONION_BLINDING, vec![0; 32])
6624
6625
} else if (error_code & 0x1000) != 0 {
6625
6626
let (real_code, error_data) = self.get_htlc_inbound_temp_fail_err_and_data(error_code, chan);
0 commit comments