Merge pull request #2668 from TheBlueMatt/2023-10-fix-doc
authorvalentinewallace <valentinewallace@users.noreply.github.com>
Mon, 30 Oct 2023 20:21:36 +0000 (16:21 -0400)
committerGitHub <noreply@github.com>
Mon, 30 Oct 2023 20:21:36 +0000 (16:21 -0400)
Update docs on `MonitorEvent::HolderForceClosed`

1  2 
lightning/src/chain/channelmonitor.rs

index 37c3383a3ad566942efcc965742bb6099c53b5c2,b959ff841d2a843497eece71b7bfe0335efe9035..af0f56d882ad591531163df08f9aa05516af92a3
@@@ -42,7 -42,7 +42,7 @@@ use crate::chain
  use crate::chain::{BestBlock, WatchedOutput};
  use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator, LowerBoundedFeeEstimator};
  use crate::chain::transaction::{OutPoint, TransactionData};
 -use crate::sign::{SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, WriteableEcdsaChannelSigner, SignerProvider, EntropySource};
 +use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, SpendableOutputDescriptor, StaticPaymentOutputDescriptor, DelayedPaymentOutputDescriptor, WriteableEcdsaChannelSigner, SignerProvider, EntropySource};
  use crate::chain::onchaintx::{ClaimEvent, OnchainTxHandler};
  use crate::chain::package::{CounterpartyOfferedHTLCOutput, CounterpartyReceivedHTLCOutput, HolderFundingOutput, HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedOutput, RevokedHTLCOutput};
  use crate::chain::Filter;
@@@ -50,7 -50,7 +50,7 @@@ use crate::util::logger::Logger
  use crate::util::ser::{Readable, ReadableArgs, RequiredWrapper, MaybeReadable, UpgradableRequired, Writer, Writeable, U48};
  use crate::util::byte_utils;
  use crate::events::{Event, EventHandler};
 -use crate::events::bump_transaction::{ChannelDerivationParameters, AnchorDescriptor, HTLCDescriptor, BumpTransactionEvent};
 +use crate::events::bump_transaction::{AnchorDescriptor, BumpTransactionEvent};
  
  use crate::prelude::*;
  use core::{cmp, mem};
@@@ -132,7 -132,8 +132,8 @@@ pub enum MonitorEvent 
        /// A monitor event containing an HTLCUpdate.
        HTLCEvent(HTLCUpdate),
  
-       /// A monitor event that the Channel's commitment transaction was confirmed.
+       /// Indicates we broadcasted the channel's latest commitment transaction and thus closed the
+       /// channel.
        HolderForceClosed(OutPoint),
  
        /// Indicates a [`ChannelMonitor`] update has completed. See
@@@ -1172,10 -1173,9 +1173,10 @@@ impl<Signer: WriteableEcdsaChannelSigne
                        (holder_commitment_tx, trusted_tx.commitment_number())
                };
  
 -              let onchain_tx_handler =
 -                      OnchainTxHandler::new(destination_script.clone(), keys,
 -                      channel_parameters.clone(), initial_holder_commitment_tx, secp_ctx);
 +              let onchain_tx_handler = OnchainTxHandler::new(
 +                      channel_value_satoshis, channel_keys_id, destination_script.clone(), keys,
 +                      channel_parameters.clone(), initial_holder_commitment_tx, secp_ctx
 +              );
  
                let mut outputs_to_watch = HashMap::new();
                outputs_to_watch.insert(funding_info.0.txid, vec![(funding_info.0.index as u32, funding_info.1.clone())]);
@@@ -2836,7 -2836,6 +2837,7 @@@ impl<Signer: WriteableEcdsaChannelSigne
                                                        per_commitment_point: self.onchain_tx_handler.signer.get_per_commitment_point(
                                                                htlc.per_commitment_number, &self.onchain_tx_handler.secp_ctx,
                                                        ),
 +                                                      feerate_per_kw: 0,
                                                        htlc: htlc.htlc,
                                                        preimage: htlc.preimage,
                                                        counterparty_sig: htlc.counterparty_sig,
                                                continue;
                                        }
                                } else { None };
 -                              if let Some(htlc_tx) = self.onchain_tx_handler.unsafe_get_fully_signed_htlc_tx(
 +                              if let Some(htlc_tx) = self.onchain_tx_handler.get_fully_signed_htlc_tx(
                                        &::bitcoin::OutPoint { txid, vout }, &preimage) {
                                        holder_transactions.push(htlc_tx);
                                }