pub fn new_missing_holder_sig(unsigned_tx: Transaction, counterparty_sig: Signature, holder_funding_key: &PublicKey, counterparty_funding_key: &PublicKey, keys: TxCreationKeys, feerate_per_kw: u32, htlc_data: Vec<(HTLCOutputInCommitment, Option<Signature>)>) -> HolderCommitmentTransaction {
		if unsigned_tx.input.len() != 1 { panic!("Tried to store a commitment transaction that had input count != 1!"); }
		if unsigned_tx.input[0].witness.len() != 0 { panic!("Tried to store a signed commitment transaction?"); }

		for htlc in &htlc_data {
			if let Some(index) = htlc.0.transaction_output_index {
				let out = &unsigned_tx.output[index as usize];
				if out.value != htlc.0.amount_msat / 1000 {
					panic!("HTLC at index {} has incorrect amount", index);
				}
				if !out.script_pubkey.is_v0_p2wsh() {
					panic!("HTLC at index {} doesn't have p2wsh scriptPubkey", index);
				}
			}
		}

		Self {
			unsigned_tx,
			counterparty_sig,
			holder_sig_first: holder_funding_key.serialize()[..] < counterparty_funding_key.serialize()[..],
			keys,
			feerate_per_kw,
			per_htlc: htlc_data,
		}
	}
/// Generate a new HolderCommitmentTransaction based on a raw commitment transaction,
/// counterparty signature and both parties keys.
///
/// The unsigned transaction outputs must be consistent with htlc_data.  This function
/// only checks that the shape and amounts are consistent, but does not check the scriptPubkey.
Generate a new HolderCommitmentTransaction based on a raw commitment transaction,
counterparty signature and both parties keys.

The unsigned transaction outputs must be consistent with htlc_data.  This function
only checks that the shape and amounts are consistent, but does not check the scriptPubkey.
Generate a new HolderCommitmentTransaction based on a raw commitment transaction counterparty signature and both parties keys . The unsigned transaction outputs must be consistent with htlc_data . This function only checks that the shape and amounts are consistent but does not check the scriptPubkey .
pub fn new_missing_holder_sig(unsigned_tx: Transaction, counterparty_sig: Signature, holder_funding_key: &PublicKey, counterparty_funding_key: &PublicKey, keys: TxCreationKeys, feerate_per_kw: u32, htlc_data: Vec<(HTLCOutputInCommitment, Option<Signature>)>) -> HolderCommitmentTransaction {
		if unsigned_tx.input.len() != 1 { panic!("Tried to store a commitment transaction that had input count != 1!"); }
		if unsigned_tx.input[0].witness.len() != 0 { panic!("Tried to store a signed commitment transaction?"); }
		for htlc in &htlc_data {
			if let Some(index) = htlc.0.transaction_output_index {
				let out = &unsigned_tx.output[index as usize];
				if out.value != htlc.0.amount_msat / 1000 {
					panic!("HTLC at index {} has incorrect amount", index);
				}
				if !out.script_pubkey.is_v0_p2wsh() {
					panic!("HTLC at index {} doesn't have p2wsh scriptPubkey", index);
				}
			}
		}
		Self {
			unsigned_tx,
			counterparty_sig,
			holder_sig_first: holder_funding_key.serialize()[..] < counterparty_funding_key.serialize()[..],
			keys,
			feerate_per_kw,
			per_htlc: htlc_data,
		}
	}
pub fn new_missing_holder_sig ( unsigned_tx : Transaction , counterparty_sig : Signature , holder_funding_key : & PublicKey , counterparty_funding_key : & PublicKey , keys : TxCreationKeys , feerate_per_kw : u32 , htlc_data : Vec < ( HTLCOutputInCommitment , Option < Signature > ) > ) -> HolderCommitmentTransaction { if unsigned_tx . input . len ( ) != 1 { panic ! ( " " ) ; } if unsigned_tx . input [ 0 ] . witness . len ( ) != 0 { panic ! ( " " ) ; } for htlc in & htlc_data { if let Some ( index ) = htlc . 0 . transaction_output_index { let out = & unsigned_tx . output [ index as usize ] ; if out . value != htlc . 0 . amount_msat / 1000 { panic ! ( " " index ) ; } if ! out . script_pubkey . is_v0_p2wsh ( ) { panic ! ( " " index ) ; } } } Self { unsigned_tx , counterparty_sig , holder_sig_first : holder_funding_key . serialize ( ) [ .. ] < counterparty_funding_key . serialize ( ) [ .. ] , keys , feerate_per_kw , per_htlc : htlc_data , } }
Generate a new HolderCommitmentTransaction based on a raw commitment transaction,
counterparty signature and both parties keys.
Generate a new HolderCommitmentTransaction based on a raw commitment transaction counterparty signature and both parties keys .
unsigned_tx
Transaction
counterparty_sig
Signature
holder_funding_key
&PublicKey
counterparty_funding_key
&PublicKey
keys
TxCreationKeys
feerate_per_kw
u32
htlc_data
Vec<(HTLCOutputInCommitment, Option<Signature>)>
unsigned_tx
Transaction
counterparty_sig
Signature
holder_funding_key
&PublicKey
counterparty_funding_key
&PublicKey
keys
TxCreationKeys
feerate_per_kw
u32
htlc_data
Vec<(HTLCOutputInCommitment, Option<Signature>)>