@@ -1517,7 +1517,7 @@ impl CommitmentTransaction {
1517
1517
let keys = TxCreationKeys :: from_channel_static_keys ( per_commitment_point, channel_parameters. broadcaster_pubkeys ( ) , channel_parameters. countersignatory_pubkeys ( ) , secp_ctx) ;
1518
1518
1519
1519
// 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) ;
1521
1521
1522
1522
let ( obscured_commitment_transaction_number, txins) = Self :: internal_build_inputs ( commitment_number, channel_parameters) ;
1523
1523
let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
@@ -1546,19 +1546,19 @@ impl CommitmentTransaction {
1546
1546
self
1547
1547
}
1548
1548
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 {
1550
1550
let ( obscured_commitment_transaction_number, txins) = Self :: internal_build_inputs ( self . commitment_number , channel_parameters) ;
1551
1551
1552
1552
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) ;
1554
1554
1555
1555
let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
1556
1556
let txid = transaction. compute_txid ( ) ;
1557
1557
let built_transaction = BuiltCommitmentTransaction {
1558
1558
transaction,
1559
1559
txid
1560
1560
} ;
1561
- Ok ( built_transaction)
1561
+ built_transaction
1562
1562
}
1563
1563
1564
1564
fn make_transaction ( obscured_commitment_transaction_number : u64 , txins : Vec < TxIn > , outputs : Vec < TxOut > ) -> Transaction {
@@ -1574,7 +1574,7 @@ impl CommitmentTransaction {
1574
1574
// - initial sorting of outputs / HTLCs in the constructor, in which case T is auxiliary data the
1575
1575
// caller needs to have sorted together with the HTLCs so it can keep track of the output index
1576
1576
// - 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 > ) {
1578
1578
let countersignatory_payment_point = & channel_parameters. countersignatory_pubkeys ( ) . payment_point ;
1579
1579
let countersignatory_funding_key = & channel_parameters. countersignatory_pubkeys ( ) . funding_pubkey ;
1580
1580
let broadcaster_funding_key = & channel_parameters. broadcaster_pubkeys ( ) . funding_pubkey ;
@@ -1671,7 +1671,7 @@ impl CommitmentTransaction {
1671
1671
}
1672
1672
outputs. push ( out. 0 ) ;
1673
1673
}
1674
- Ok ( ( outputs, htlcs) )
1674
+ ( outputs, htlcs)
1675
1675
}
1676
1676
1677
1677
fn internal_build_inputs ( commitment_number : u64 , channel_parameters : & DirectedChannelTransactionParameters ) -> ( u64 , Vec < TxIn > ) {
@@ -1757,7 +1757,7 @@ impl CommitmentTransaction {
1757
1757
if keys != self . keys {
1758
1758
return Err ( ( ) ) ;
1759
1759
}
1760
- let tx = self . internal_rebuild_transaction ( & keys, channel_parameters) ? ;
1760
+ let tx = self . internal_rebuild_transaction ( & keys, channel_parameters) ;
1761
1761
if self . built . transaction != tx. transaction || self . built . txid != tx. txid {
1762
1762
return Err ( ( ) ) ;
1763
1763
}
0 commit comments