-/// Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
-/// the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
-/// fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
-/// a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
-/// transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
-/// broadcast them if counterparty don't close channel with his higher commitment transaction after a
-/// substantial amount of time (a month or even a year) to get back funds. Best may be to contact
-/// out-of-band the other node operator to coordinate with him if option is available to you.
-/// In any-case, choice is up to the user.
+/// Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
+/// signing the justice transaction easier for implementors of
+/// [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
+/// signing the input at `input_idx`. This method will only produce a valid signature for
+/// a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
+/// be used for revoked HTLC outputs.
+///
+/// `Value` is the value of the output being spent by the input at `input_idx`, committed
+/// in the BIP 143 signature.
+///
+/// This method will only succeed if this monitor has received the revocation secret for the
+/// provided `commitment_number`. If a commitment number is provided that does not correspond
+/// to the commitment transaction being revoked, this will return a signed transaction, but
+/// the signature will not be valid.
+///
+/// [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::EcdsaChannelSigner::sign_justice_revoked_output
+/// [`Persist`]: crate::chain::chainmonitor::Persist
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelMonitor_sign_to_local_justice_tx(this_arg: &crate::lightning::chain::channelmonitor::ChannelMonitor, mut justice_tx: crate::c_types::Transaction, mut input_idx: usize, mut value: u64, mut commitment_number: u64) -> crate::c_types::derived::CResult_TransactionNoneZ {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.sign_to_local_justice_tx(justice_tx.into_bitcoin(), input_idx, value, commitment_number);
+ let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::Transaction::from_bitcoin(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
+ local_ret
+}
+
+/// Gets the `node_id` of the counterparty for this channel.
+///
+/// Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
+/// otherwise.
+///
+/// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelMonitor_get_counterparty_node_id(this_arg: &crate::lightning::chain::channelmonitor::ChannelMonitor) -> crate::c_types::PublicKey {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.get_counterparty_node_id();
+ let mut local_ret = if ret.is_none() { crate::c_types::PublicKey::null() } else { { crate::c_types::PublicKey::from_rust(&(ret.unwrap())) } };
+ local_ret
+}
+
+/// Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
+/// of the channel state was out-of-date.
+///
+/// You may also use this to broadcast the latest local commitment transaction, either because
+/// a monitor update failed or because we've fallen behind (i.e. we've received proof that our
+/// counterparty side knows a revocation secret we gave them that they shouldn't know).
+///
+/// Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
+/// side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
+/// close channel with their commitment transaction after a substantial amount of time. Best
+/// may be to contact the other node operator out-of-band to coordinate other options available
+/// to you.
+///
+/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager