@@ -1517,7 +1517,7 @@ impl CommitmentTransaction {
15171517 let keys = TxCreationKeys :: from_channel_static_keys ( per_commitment_point, channel_parameters. broadcaster_pubkeys ( ) , channel_parameters. countersignatory_pubkeys ( ) , secp_ctx) ;
15181518
15191519 // Sort outputs and populate output indices while keeping track of the auxiliary data
1520- let ( outputs, htlcs) = Self :: internal_build_outputs ( & keys, to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs_with_aux, channel_parameters) . unwrap ( ) ;
1520+ let ( outputs, htlcs) = Self :: internal_build_outputs ( & keys, to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs_with_aux, channel_parameters) ;
15211521
15221522 let ( obscured_commitment_transaction_number, txins) = Self :: internal_build_inputs ( commitment_number, channel_parameters) ;
15231523 let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
@@ -1546,19 +1546,19 @@ impl CommitmentTransaction {
15461546 self
15471547 }
15481548
1549- fn internal_rebuild_transaction ( & self , keys : & TxCreationKeys , channel_parameters : & DirectedChannelTransactionParameters ) -> Result < BuiltCommitmentTransaction , ( ) > {
1549+ fn internal_rebuild_transaction ( & self , keys : & TxCreationKeys , channel_parameters : & DirectedChannelTransactionParameters ) -> BuiltCommitmentTransaction {
15501550 let ( obscured_commitment_transaction_number, txins) = Self :: internal_build_inputs ( self . commitment_number , channel_parameters) ;
15511551
15521552 let mut htlcs_with_aux = self . htlcs . iter ( ) . map ( |h| ( h. clone ( ) , ( ) ) ) . collect ( ) ;
1553- let ( outputs, _) = Self :: internal_build_outputs ( keys, self . to_broadcaster_value_sat , self . to_countersignatory_value_sat , & mut htlcs_with_aux, channel_parameters) ? ;
1553+ let ( outputs, _) = Self :: internal_build_outputs ( keys, self . to_broadcaster_value_sat , self . to_countersignatory_value_sat , & mut htlcs_with_aux, channel_parameters) ;
15541554
15551555 let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
15561556 let txid = transaction. compute_txid ( ) ;
15571557 let built_transaction = BuiltCommitmentTransaction {
15581558 transaction,
15591559 txid
15601560 } ;
1561- Ok ( built_transaction)
1561+ built_transaction
15621562 }
15631563
15641564 fn make_transaction ( obscured_commitment_transaction_number : u64 , txins : Vec < TxIn > , outputs : Vec < TxOut > ) -> Transaction {
@@ -1574,7 +1574,7 @@ impl CommitmentTransaction {
15741574 // - initial sorting of outputs / HTLCs in the constructor, in which case T is auxiliary data the
15751575 // caller needs to have sorted together with the HTLCs so it can keep track of the output index
15761576 // - building of a bitcoin transaction during a verify() call, in which case T is just ()
1577- fn internal_build_outputs < T > ( keys : & TxCreationKeys , to_broadcaster_value_sat : Amount , to_countersignatory_value_sat : Amount , htlcs_with_aux : & mut Vec < ( HTLCOutputInCommitment , T ) > , channel_parameters : & DirectedChannelTransactionParameters ) -> Result < ( Vec < TxOut > , Vec < HTLCOutputInCommitment > ) , ( ) > {
1577+ fn internal_build_outputs < T > ( keys : & TxCreationKeys , to_broadcaster_value_sat : Amount , to_countersignatory_value_sat : Amount , htlcs_with_aux : & mut Vec < ( HTLCOutputInCommitment , T ) > , channel_parameters : & DirectedChannelTransactionParameters ) -> ( Vec < TxOut > , Vec < HTLCOutputInCommitment > ) {
15781578 let countersignatory_payment_point = & channel_parameters. countersignatory_pubkeys ( ) . payment_point ;
15791579 let countersignatory_funding_key = & channel_parameters. countersignatory_pubkeys ( ) . funding_pubkey ;
15801580 let broadcaster_funding_key = & channel_parameters. broadcaster_pubkeys ( ) . funding_pubkey ;
@@ -1671,7 +1671,7 @@ impl CommitmentTransaction {
16711671 }
16721672 outputs. push ( out. 0 ) ;
16731673 }
1674- Ok ( ( outputs, htlcs) )
1674+ ( outputs, htlcs)
16751675 }
16761676
16771677 fn internal_build_inputs ( commitment_number : u64 , channel_parameters : & DirectedChannelTransactionParameters ) -> ( u64 , Vec < TxIn > ) {
@@ -1757,7 +1757,7 @@ impl CommitmentTransaction {
17571757 if keys != self . keys {
17581758 return Err ( ( ) ) ;
17591759 }
1760- let tx = self . internal_rebuild_transaction ( & keys, channel_parameters) ? ;
1760+ let tx = self . internal_rebuild_transaction ( & keys, channel_parameters) ;
17611761 if self . built . transaction != tx. transaction || self . built . txid != tx. txid {
17621762 return Err ( ( ) ) ;
17631763 }
0 commit comments