@@ -5249,16 +5249,20 @@ where
5249
5249
"Failing {}HTLC with payment_hash {} backwards from us: {:?}",
5250
5250
if blinded_failure.is_some() { "blinded " } else { "" }, &payment_hash, onion_error
5251
5251
);
5252
- let err_packet = match blinded_failure {
5252
+ let failure = match blinded_failure {
5253
5253
Some(BlindedFailure::FromIntroductionNode) => {
5254
5254
let blinded_onion_error = HTLCFailReason::reason(INVALID_ONION_BLINDING, vec![0; 32]);
5255
- blinded_onion_error.get_encrypted_failure_packet(
5255
+ let err_packet = blinded_onion_error.get_encrypted_failure_packet(
5256
5256
incoming_packet_shared_secret, phantom_shared_secret
5257
- )
5257
+ );
5258
+ HTLCForwardInfo::FailHTLC { htlc_id: *htlc_id, err_packet }
5258
5259
},
5259
5260
Some(BlindedFailure::FromBlindedNode) => todo!(),
5260
5261
None => {
5261
- onion_error.get_encrypted_failure_packet(incoming_packet_shared_secret, phantom_shared_secret)
5262
+ let err_packet = onion_error.get_encrypted_failure_packet(
5263
+ incoming_packet_shared_secret, phantom_shared_secret
5264
+ );
5265
+ HTLCForwardInfo::FailHTLC { htlc_id: *htlc_id, err_packet }
5262
5266
}
5263
5267
};
5264
5268
@@ -5269,10 +5273,10 @@ where
5269
5273
}
5270
5274
match forward_htlcs.entry(*short_channel_id) {
5271
5275
hash_map::Entry::Occupied(mut entry) => {
5272
- entry.get_mut().push(HTLCForwardInfo::FailHTLC { htlc_id: *htlc_id, err_packet } );
5276
+ entry.get_mut().push(failure );
5273
5277
},
5274
5278
hash_map::Entry::Vacant(entry) => {
5275
- entry.insert(vec!(HTLCForwardInfo::FailHTLC { htlc_id: *htlc_id, err_packet } ));
5279
+ entry.insert(vec!(failure ));
5276
5280
}
5277
5281
}
5278
5282
mem::drop(forward_htlcs);
0 commit comments