@@ -6511,7 +6511,7 @@ where
6511
6511
if let hash_map::Entry::Occupied(mut chan_phase_entry) = peer_state.channel_by_id.entry(chan_id) {
6512
6512
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
6513
6513
let counterparty_node_id = chan.context.get_counterparty_node_id();
6514
- let logger = WithChannelContext::from(&self.logger, &chan.context, None );
6514
+ let logger = WithChannelContext::from(&self.logger, &chan.context, Some(PaymentHash(Sha256::hash(&payment_preimage.0).to_byte_array())) );
6515
6515
let fulfill_res = chan.get_update_fulfill_htlc_and_commit(prev_hop.htlc_id, payment_preimage, &&logger);
6516
6516
6517
6517
match fulfill_res {
@@ -6604,7 +6604,8 @@ where
6604
6604
// with a preimage we *must* somehow manage to propagate it to the upstream
6605
6605
// channel, or we must have an ability to receive the same event and try
6606
6606
// again on restart.
6607
- log_error!(WithContext::from(&self.logger, None, Some(prev_hop.channel_id), None),
6607
+ log_error!(WithContext::from(&self.logger, None, Some(prev_hop.channel_id), Some(
6608
+ PaymentHash(Sha256::hash(&payment_preimage.0).to_byte_array()))),
6608
6609
"Critical error: failed to update channel monitor with preimage {:?}: {:?}",
6609
6610
payment_preimage, update_res);
6610
6611
}
@@ -7757,7 +7758,7 @@ where
7757
7758
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
7758
7759
let res = try_chan_phase_entry!(self, chan.update_fulfill_htlc(&msg), chan_phase_entry);
7759
7760
if let HTLCSource::PreviousHopData(prev_hop) = &res.0 {
7760
- let logger = WithChannelContext::from(&self.logger, &chan.context, None );
7761
+ let logger = WithChannelContext::from(&self.logger, &chan.context, Some(PaymentHash(Sha256::hash(&msg.payment_preimage.0).to_byte_array())) );
7761
7762
log_trace!(logger,
7762
7763
"Holding the next revoke_and_ack from {} until the preimage is durably persisted in the inbound edge's ChannelMonitor",
7763
7764
msg.channel_id);
0 commit comments