X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannelmanager.rs;h=1b5813a301851229fdd2967dc22e025042b2cab8;hb=843d25d750c3408d3f8f917764b8a58019a9dd81;hp=ad8603312fc714243a4129acf381d5b4a7332224;hpb=928bfb12d2d0d02ae0b5a68a81a6b4a651561c69;p=rust-lightning diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index ad860331..1b5813a3 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -2178,7 +2178,7 @@ impl ChannelMana } } else { return Err(PaymentSendFailure::ParameterError(APIError::APIMisuseError { - err: "Payment with ID {} not found".to_string() + err: format!("Payment with ID {} not found", log_bytes!(payment_id.0)), })) } }; @@ -3308,8 +3308,12 @@ impl ChannelMana sessions.remove(&session_priv_bytes, path.last().unwrap().fee_msat) } else { false }; if found_payment { + let payment_hash = PaymentHash(Sha256::hash(&payment_preimage.0).into_inner()); self.pending_events.lock().unwrap().push( - events::Event::PaymentSent { payment_preimage } + events::Event::PaymentSent { + payment_preimage, + payment_hash: payment_hash + } ); } else { log_trace!(self.logger, "Received duplicative fulfill for HTLC with payment_preimage {}", log_bytes!(payment_preimage.0)); @@ -6017,8 +6021,9 @@ mod tests { // further events will be generated for subsequence path successes. let events = nodes[0].node.get_and_clear_pending_events(); match events[0] { - Event::PaymentSent { payment_preimage: ref preimage } => { + Event::PaymentSent { payment_preimage: ref preimage, payment_hash: ref hash } => { assert_eq!(payment_preimage, *preimage); + assert_eq!(our_payment_hash, *hash); }, _ => panic!("Unexpected event"), }