Skip to content

Commit

Permalink
f Convert PaymentPreimage to PaymentHasH
Browse files Browse the repository at this point in the history
  • Loading branch information
jbesraa committed May 10, 2024
1 parent 5776c43 commit 571e452
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6511,7 +6511,7 @@ where
if let hash_map::Entry::Occupied(mut chan_phase_entry) = peer_state.channel_by_id.entry(chan_id) {
if let ChannelPhase::Funded(chan) = chan_phase_entry.get_mut() {
let counterparty_node_id = chan.context.get_counterparty_node_id();
let logger = WithChannelContext::from(&self.logger, &chan.context, None);
let logger = WithChannelContext::from(&self.logger, &chan.context, Some(PaymentHash(Sha256::hash(&payment_preimage.0).to_byte_array())));
let fulfill_res = chan.get_update_fulfill_htlc_and_commit(prev_hop.htlc_id, payment_preimage, &&logger);

match fulfill_res {
Expand Down Expand Up @@ -6604,7 +6604,8 @@ where
// with a preimage we *must* somehow manage to propagate it to the upstream
// channel, or we must have an ability to receive the same event and try
// again on restart.
log_error!(WithContext::from(&self.logger, None, Some(prev_hop.channel_id), None),
log_error!(WithContext::from(&self.logger, None, Some(prev_hop.channel_id), Some(
PaymentHash(Sha256::hash(&payment_preimage.0).to_byte_array()))),
"Critical error: failed to update channel monitor with preimage {:?}: {:?}",
payment_preimage, update_res);
}
Expand Down

0 comments on commit 571e452

Please sign in to comment.