@@ -1451,10 +1451,8 @@ impl CommitmentTransaction {
1451
1451
1452
1452
// Sort outputs and populate output indices while keeping track of the auxiliary data
1453
1453
let htlcs: Vec < & mut HTLCOutputInCommitment > = htlcs_with_aux. iter_mut ( ) . map ( |( htlc, _) | htlc) . collect ( ) ;
1454
- let ( outputs , sorted_htlcs) = signer. build_outputs ( & keys. per_commitment_point , to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs, secp_ctx, is_holder_tx, commitment_number) . unwrap ( ) ;
1454
+ let ( transaction , sorted_htlcs) = signer. build_transaction ( & keys. per_commitment_point , to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs, secp_ctx, is_holder_tx, commitment_number) ;
1455
1455
1456
- let ( obscured_commitment_transaction_number, txins) = signer. build_inputs ( commitment_number, is_holder_tx) ;
1457
- let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
1458
1456
let txid = transaction. compute_txid ( ) ;
1459
1457
CommitmentTransaction {
1460
1458
commitment_number,
@@ -1481,13 +1479,10 @@ impl CommitmentTransaction {
1481
1479
}
1482
1480
1483
1481
fn internal_rebuild_transaction < Signer : ChannelSigner > ( & self , per_commitment_point : & PublicKey , signer : & Signer , secp_ctx : & Secp256k1 < secp256k1:: All > , is_holder_tx : bool ) -> Result < BuiltCommitmentTransaction , ( ) > {
1484
- let ( obscured_commitment_transaction_number, txins) = signer. build_inputs ( self . commitment_number , is_holder_tx) ;
1485
-
1486
1482
let mut htlcs: Vec < _ > = self . htlcs . iter ( ) . map ( |h| h. clone ( ) ) . collect ( ) ;
1487
1483
let htlcs: Vec < & mut HTLCOutputInCommitment > = htlcs. iter_mut ( ) . collect ( ) ;
1488
- let ( outputs , _) = signer. build_outputs ( per_commitment_point, self . to_broadcaster_value_sat , self . to_countersignatory_value_sat , htlcs, secp_ctx, is_holder_tx, self . commitment_number ) ? ;
1484
+ let ( transaction , _) = signer. build_transaction ( per_commitment_point, self . to_broadcaster_value_sat , self . to_countersignatory_value_sat , htlcs, secp_ctx, is_holder_tx, self . commitment_number ) ;
1489
1485
1490
- let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
1491
1486
let txid = transaction. compute_txid ( ) ;
1492
1487
let built_transaction = BuiltCommitmentTransaction {
1493
1488
transaction,
@@ -1496,15 +1491,6 @@ impl CommitmentTransaction {
1496
1491
Ok ( built_transaction)
1497
1492
}
1498
1493
1499
- fn make_transaction ( obscured_commitment_transaction_number : u64 , txins : Vec < TxIn > , outputs : Vec < TxOut > ) -> Transaction {
1500
- Transaction {
1501
- version : Version :: TWO ,
1502
- lock_time : LockTime :: from_consensus ( ( ( 0x20 as u32 ) << 8 * 3 ) | ( ( obscured_commitment_transaction_number & 0xffffffu64 ) as u32 ) ) ,
1503
- input : txins,
1504
- output : outputs,
1505
- }
1506
- }
1507
-
1508
1494
/// The backwards-counting commitment number
1509
1495
pub fn commitment_number ( & self ) -> u64 {
1510
1496
self . commitment_number
0 commit comments