X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=f68d7433e4a0c6ebcb257ff96ab3ca7d38477e25;hb=3dffe54258a374d15571d4ec72f5faa02477b770;hp=a8e8c8053b6b5d627ad02776665cde72cf2cb3ec;hpb=75c058670cdfd2db97102d70d869757a77f1ac04;p=rust-lightning diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index a8e8c805..f68d7433 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -2206,8 +2206,6 @@ impl Channel where } assert_eq!(self.context.channel_state & ChannelState::ShutdownComplete as u32, 0); - let payment_hash_calc = PaymentHash(Sha256::hash(&payment_preimage_arg.0[..]).into_inner()); - // ChannelManager may generate duplicate claims/fails due to HTLC update events from // on-chain ChannelsMonitors during block rescan. Ideally we'd figure out a way to drop // these, but for now we just have to treat them as normal. @@ -2216,7 +2214,9 @@ impl Channel where let mut htlc_value_msat = 0; for (idx, htlc) in self.context.pending_inbound_htlcs.iter().enumerate() { if htlc.htlc_id == htlc_id_arg { - assert_eq!(htlc.payment_hash, payment_hash_calc); + debug_assert_eq!(htlc.payment_hash, PaymentHash(Sha256::hash(&payment_preimage_arg.0[..]).into_inner())); + log_debug!(logger, "Claiming inbound HTLC id {} with payment hash {} with preimage {}", + htlc.htlc_id, htlc.payment_hash, payment_preimage_arg); match htlc.state { InboundHTLCState::Committed => {}, InboundHTLCState::LocalRemoved(ref reason) => { @@ -5216,7 +5216,8 @@ impl Channel where } let need_holding_cell = (self.context.channel_state & (ChannelState::AwaitingRemoteRevoke as u32 | ChannelState::MonitorUpdateInProgress as u32)) != 0; - log_debug!(logger, "Pushing new outbound HTLC for {} msat {}", amount_msat, + log_debug!(logger, "Pushing new outbound HTLC with hash {} for {} msat {}", + payment_hash, amount_msat, if force_holding_cell { "into holding cell" } else if need_holding_cell { "into holding cell as we're awaiting an RAA or monitor" } else { "to peer" });