+ htlcs
+ }
+ pub(crate) fn finalize_malleable_package<L: Deref, Signer: Sign>(
+ &self, onchain_handler: &mut OnchainTxHandler<Signer>, value: u64, destination_script: Script, logger: &L
+ ) -> Option<Transaction> where L::Target: Logger {
+ debug_assert!(self.is_malleable());
+ let mut bumped_tx = Transaction {
+ version: 2,
+ lock_time: PackedLockTime::ZERO,
+ input: vec![],
+ output: vec![TxOut {
+ script_pubkey: destination_script,
+ value,
+ }],
+ };
+ for (outpoint, _) in self.inputs.iter() {
+ bumped_tx.input.push(TxIn {
+ previous_output: *outpoint,
+ script_sig: Script::new(),
+ sequence: Sequence::ENABLE_RBF_NO_LOCKTIME,
+ witness: Witness::new(),
+ });
+ }
+ for (i, (outpoint, out)) in self.inputs.iter().enumerate() {
+ log_debug!(logger, "Adding claiming input for outpoint {}:{}", outpoint.txid, outpoint.vout);
+ if !out.finalize_input(&mut bumped_tx, i, onchain_handler) { return None; }
+ }
+ log_debug!(logger, "Finalized transaction {} ready to broadcast", bumped_tx.txid());
+ Some(bumped_tx)
+ }
+ pub(crate) fn finalize_untractable_package<L: Deref, Signer: Sign>(
+ &self, onchain_handler: &mut OnchainTxHandler<Signer>, logger: &L,
+ ) -> Option<Transaction> where L::Target: Logger {
+ debug_assert!(!self.is_malleable());
+ if let Some((outpoint, outp)) = self.inputs.first() {
+ if let Some(final_tx) = outp.get_finalized_tx(outpoint, onchain_handler) {
+ log_debug!(logger, "Adding claiming input for outpoint {}:{}", outpoint.txid, outpoint.vout);
+ log_debug!(logger, "Finalized transaction {} ready to broadcast", final_tx.txid());
+ return Some(final_tx);
+ }
+ return None;
+ } else { panic!("API Error: Package must not be inputs empty"); }