@@ -2970,7 +2970,7 @@ where
2970
2970
}
2971
2971
2972
2972
fn decode_update_add_htlc_onion(
2973
- &self, msg: &msgs::UpdateAddHTLC
2973
+ &self, msg: &msgs::UpdateAddHTLC, counterparty_node_id: &PublicKey,
2974
2974
) -> Result<
2975
2975
(onion_utils::Hop, [u8; 32], Option<Result<PublicKey, secp256k1::Error>>), HTLCFailureMsg
2976
2976
> {
@@ -2989,7 +2989,7 @@ where
2989
2989
($msg: expr, $err_code: expr, $data: expr) => {
2990
2990
{
2991
2991
log_info!(
2992
- WithContext::from(&self.logger, None , Some(msg.channel_id)),
2992
+ WithContext::from(&self.logger, Some(*counterparty_node_id) , Some(msg.channel_id)),
2993
2993
"Failed to accept/forward incoming HTLC: {}", $msg
2994
2994
);
2995
2995
let (err_code, err_data) = if is_blinded {
@@ -3136,13 +3136,15 @@ where
3136
3136
}
3137
3137
3138
3138
fn construct_pending_htlc_status<'a>(
3139
- &self, msg: &msgs::UpdateAddHTLC, shared_secret: [u8; 32], decoded_hop: onion_utils::Hop,
3140
- allow_underpay: bool, next_packet_pubkey_opt: Option<Result<PublicKey, secp256k1::Error>>
3139
+ &self, msg: &msgs::UpdateAddHTLC, counterparty_node_id: &PublicKey, shared_secret: [u8; 32],
3140
+ decoded_hop: onion_utils::Hop, allow_underpay: bool,
3141
+ next_packet_pubkey_opt: Option<Result<PublicKey, secp256k1::Error>>,
3141
3142
) -> PendingHTLCStatus {
3142
3143
macro_rules! return_err {
3143
3144
($msg: expr, $err_code: expr, $data: expr) => {
3144
3145
{
3145
- log_info!(WithContext::from(&self.logger, None, Some(msg.channel_id)), "Failed to accept/forward incoming HTLC: {}", $msg);
3146
+ let logger = WithContext::from(&self.logger, Some(*counterparty_node_id), Some(msg.channel_id));
3147
+ log_info!(logger, "Failed to accept/forward incoming HTLC: {}", $msg);
3146
3148
return PendingHTLCStatus::Fail(HTLCFailureMsg::Relay(msgs::UpdateFailHTLC {
3147
3149
channel_id: msg.channel_id,
3148
3150
htlc_id: msg.htlc_id,
@@ -6458,7 +6460,7 @@ where
6458
6460
// Note that the ChannelManager is NOT re-persisted on disk after this (unless we error
6459
6461
// closing a channel), so any changes are likely to be lost on restart!
6460
6462
6461
- let decoded_hop_res = self.decode_update_add_htlc_onion(msg);
6463
+ let decoded_hop_res = self.decode_update_add_htlc_onion(msg, counterparty_node_id );
6462
6464
let per_peer_state = self.per_peer_state.read().unwrap();
6463
6465
let peer_state_mutex = per_peer_state.get(counterparty_node_id)
6464
6466
.ok_or_else(|| {
@@ -6472,8 +6474,10 @@ where
6472
6474
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
6473
6475
let pending_forward_info = match decoded_hop_res {
6474
6476
Ok((next_hop, shared_secret, next_packet_pk_opt)) =>
6475
- self.construct_pending_htlc_status(msg, shared_secret, next_hop,
6476
- chan.context.config().accept_underpaying_htlcs, next_packet_pk_opt),
6477
+ self.construct_pending_htlc_status(
6478
+ msg, counterparty_node_id, shared_secret, next_hop,
6479
+ chan.context.config().accept_underpaying_htlcs, next_packet_pk_opt,
6480
+ ),
6477
6481
Err(e) => PendingHTLCStatus::Fail(e)
6478
6482
};
6479
6483
let create_pending_htlc_status = |chan: &Channel<SP>, pending_forward_info: PendingHTLCStatus, error_code: u16| {
0 commit comments