- pub(crate) fn finalize_malleable_package<L: Deref, Signer: Sign>(
- &self, onchain_handler: &mut OnchainTxHandler<Signer>, value: u64, destination_script: Script, logger: &L
+ #[cfg(anchors)]
+ pub(crate) fn construct_malleable_package_with_external_funding<Signer: WriteableEcdsaChannelSigner>(
+ &self, onchain_handler: &mut OnchainTxHandler<Signer>,
+ ) -> Option<Vec<ExternalHTLCClaim>> {
+ debug_assert!(self.requires_external_funding());
+ let mut htlcs: Option<Vec<ExternalHTLCClaim>> = None;
+ for (previous_output, input) in &self.inputs {
+ match input {
+ PackageSolvingData::HolderHTLCOutput(ref outp) => {
+ debug_assert!(outp.opt_anchors());
+ onchain_handler.generate_external_htlc_claim(&previous_output, &outp.preimage).map(|htlc| {
+ htlcs.get_or_insert_with(|| Vec::with_capacity(self.inputs.len())).push(htlc);
+ });
+ }
+ _ => debug_assert!(false, "Expected HolderHTLCOutputs to not be aggregated with other input types"),
+ }
+ }
+ htlcs
+ }
+ pub(crate) fn finalize_malleable_package<L: Deref, Signer: WriteableEcdsaChannelSigner>(
+ &self, current_height: u32, onchain_handler: &mut OnchainTxHandler<Signer>, value: u64,
+ destination_script: Script, logger: &L