X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannelmanager.rs;h=834f84c4b9bf536e7d061adc2e644a6328f79b34;hb=101af715153ac9cbd21968b7baab49916fe65000;hp=7680bd030d5e2cf21acc1a9bc468298ad7cd81b5;hpb=3fb329b004aa5107750ef87dfd2d1766badc705e;p=rust-lightning diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 7680bd03..834f84c4 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -68,7 +68,7 @@ use crate::offers::refund::{Refund, RefundBuilder}; use crate::onion_message::messenger::{new_pending_onion_message, Destination, MessageRouter, PendingOnionMessage, Responder, ResponseInstruction}; use crate::onion_message::offers::{OffersMessage, OffersMessageHandler}; use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider}; -use crate::sign::ecdsa::WriteableEcdsaChannelSigner; +use crate::sign::ecdsa::EcdsaChannelSigner; use crate::util::config::{UserConfig, ChannelConfig, ChannelConfigUpdate}; use crate::util::wakers::{Future, Notifier}; use crate::util::scid_utils::fake_scid; @@ -1061,8 +1061,8 @@ pub trait AChannelManager { type NodeSigner: NodeSigner + ?Sized; /// A type that may be dereferenced to [`Self::NodeSigner`]. type NS: Deref; - /// A type implementing [`WriteableEcdsaChannelSigner`]. - type Signer: WriteableEcdsaChannelSigner + Sized; + /// A type implementing [`EcdsaChannelSigner`]. + type Signer: EcdsaChannelSigner + Sized; /// A type implementing [`SignerProvider`] for [`Self::Signer`]. type SignerProvider: SignerProvider + ?Sized; /// A type that may be dereferenced to [`Self::SignerProvider`]. @@ -4084,8 +4084,8 @@ where pub(crate) fn test_send_payment_along_path(&self, path: &Path, payment_hash: &PaymentHash, recipient_onion: RecipientOnionFields, total_value: u64, cur_height: u32, payment_id: PaymentId, keysend_preimage: &Option, session_priv_bytes: [u8; 32]) -> Result<(), APIError> { let _lck = self.total_consistency_lock.read().unwrap(); self.send_payment_along_path(SendAlongPathArgs { - path, payment_hash, recipient_onion, total_value, cur_height, payment_id, keysend_preimage, - session_priv_bytes + path, payment_hash, recipient_onion: &recipient_onion, total_value, + cur_height, payment_id, keysend_preimage, session_priv_bytes }) } @@ -6326,10 +6326,16 @@ where let htlcs = payment.htlcs.iter().map(events::ClaimedHTLC::from).collect(); let sender_intended_value = payment.htlcs.first().map(|htlc| htlc.total_msat); - let dup_purpose = claimable_payments.pending_claiming_payments.insert(payment_hash, - ClaimingPayment { amount_msat: payment.htlcs.iter().map(|source| source.value).sum(), - payment_purpose: payment.purpose, receiver_node_id, htlcs, sender_intended_value - }); + let dup_purpose = claimable_payments.pending_claiming_payments.insert( + payment_hash, + ClaimingPayment { + amount_msat: payment.htlcs.iter().map(|source| source.value).sum(), + payment_purpose: payment.purpose, + receiver_node_id, + htlcs, + sender_intended_value, + }, + ); if dup_purpose.is_some() { debug_assert!(false, "Shouldn't get a duplicate pending claim event ever"); log_error!(self.logger, "Got a duplicate pending claimable event on payment hash {}! Please report this bug", @@ -8563,8 +8569,6 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => { /// /// Errors if the parameterized [`Router`] is unable to create a blinded path for the offer. /// - /// This is not exported to bindings users as builder patterns don't map outside of move semantics. - /// /// [`Offer`]: crate::offers::offer::Offer /// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest pub fn create_offer_builder(&$self) -> Result<$builder, Bolt12SemanticError> { @@ -8627,8 +8631,6 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => { /// - `amount_msats` is invalid, or /// - the parameterized [`Router`] is unable to create a blinded path for the refund. /// - /// This is not exported to bindings users as builder patterns don't map outside of move semantics. - /// /// [`Refund`]: crate::offers::refund::Refund /// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice /// [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths @@ -11633,7 +11635,7 @@ where for (funding_txo, monitor) in args.channel_monitors.iter() { if !funding_txo_set.contains(funding_txo) { - let logger = WithChannelMonitor::from(&args.logger, monitor); + let logger = WithChannelMonitor::from(&args.logger, monitor, None); let channel_id = monitor.channel_id(); log_info!(logger, "Queueing monitor update to ensure missing channel {} is force closed", &channel_id); @@ -11940,8 +11942,8 @@ where for (_, monitor) in args.channel_monitors.iter() { let counterparty_opt = outpoint_to_peer.get(&monitor.get_funding_txo().0); if counterparty_opt.is_none() { - let logger = WithChannelMonitor::from(&args.logger, monitor); for (htlc_source, (htlc, _)) in monitor.get_pending_or_resolved_outbound_htlcs() { + let logger = WithChannelMonitor::from(&args.logger, monitor, Some(htlc.payment_hash)); if let HTLCSource::OutboundRoute { payment_id, session_priv, path, .. } = htlc_source { if path.hops.is_empty() { log_error!(logger, "Got an empty path for a pending payment"); @@ -11982,6 +11984,7 @@ where } } for (htlc_source, (htlc, preimage_opt)) in monitor.get_all_current_outbound_htlcs() { + let logger = WithChannelMonitor::from(&args.logger, monitor, Some(htlc.payment_hash)); match htlc_source { HTLCSource::PreviousHopData(prev_hop_data) => { let pending_forward_matches_htlc = |info: &PendingAddHTLCInfo| {