Skip to content

Commit 571e452

Browse files
committed
f Convert PaymentPreimage to PaymentHasH
1 parent 5776c43 commit 571e452

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/ln/channelmanager.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -6511,7 +6511,7 @@ where
65116511
if let hash_map::Entry::Occupied(mut chan_phase_entry) = peer_state.channel_by_id.entry(chan_id) {
65126512
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
65136513
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())));
65156515
let fulfill_res = chan.get_update_fulfill_htlc_and_commit(prev_hop.htlc_id, payment_preimage, &&logger);
65166516

65176517
match fulfill_res {
@@ -6604,7 +6604,8 @@ where
66046604
// with a preimage we *must* somehow manage to propagate it to the upstream
66056605
// channel, or we must have an ability to receive the same event and try
66066606
// 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()))),
66086609
"Critical error: failed to update channel monitor with preimage {:?}: {:?}",
66096610
payment_preimage, update_res);
66106611
}

0 commit comments

Comments
 (0)