@@ -332,7 +332,7 @@ impl PackageSolvingData {
332
332
} ;
333
333
category
334
334
}
335
- fn add_input < Signer : Sign > ( & self , bumped_tx : & mut Transaction , i : usize , onchain_handler : & mut OnchainTxHandler < Signer > ) -> bool {
335
+ fn finalize_input < Signer : Sign > ( & self , bumped_tx : & mut Transaction , i : usize , onchain_handler : & mut OnchainTxHandler < Signer > ) -> bool {
336
336
match self {
337
337
PackageSolvingData :: RevokedOutput ( ref outp) => {
338
338
if let Ok ( chan_keys) = TxCreationKeys :: derive_new ( & onchain_handler. secp_ctx , & outp. per_commitment_point , & outp. counterparty_delayed_payment_base_key , & outp. counterparty_htlc_base_key , & onchain_handler. signer . pubkeys ( ) . revocation_basepoint , & onchain_handler. signer . pubkeys ( ) . htlc_basepoint ) {
@@ -353,7 +353,6 @@ impl PackageSolvingData {
353
353
bumped_tx. input [ i] . witness . push ( witness_script. clone ( ) . into_bytes ( ) ) ;
354
354
} else { return false ; }
355
355
}
356
-
357
356
} ,
358
357
PackageSolvingData :: CounterpartyHTLCOutput ( ref outp) => {
359
358
if let Ok ( chan_keys) = TxCreationKeys :: derive_new ( & onchain_handler. secp_ctx , & outp. per_commitment_point , & outp. counterparty_delayed_payment_base_key , & outp. counterparty_htlc_base_key , & onchain_handler. signer . pubkeys ( ) . revocation_basepoint , & onchain_handler. signer . pubkeys ( ) . htlc_basepoint ) {
@@ -573,15 +572,17 @@ impl PackageTemplate {
573
572
value,
574
573
} ] ,
575
574
} ;
576
- for ( i , ( outpoint, out ) ) in self . inputs . iter ( ) . enumerate ( ) {
575
+ for ( outpoint, _ ) in self . inputs . iter ( ) {
577
576
bumped_tx. input . push ( TxIn {
578
577
previous_output : * outpoint,
579
578
script_sig : Script :: new ( ) ,
580
579
sequence : 0xfffffffd ,
581
580
witness : Vec :: new ( ) ,
582
581
} ) ;
582
+ }
583
+ for ( i, ( outpoint, out) ) in self . inputs . iter ( ) . enumerate ( ) {
583
584
log_trace ! ( logger, "Adding claiming input for outpoint {}:{}" , outpoint. txid, outpoint. vout) ;
584
- if !out. add_input ( & mut bumped_tx, i, onchain_handler) { return None ; }
585
+ if !out. finalize_input ( & mut bumped_tx, i, onchain_handler) { return None ; }
585
586
}
586
587
log_trace ! ( logger, "Finalized transaction {} ready to broadcast" , bumped_tx. txid( ) ) ;
587
588
return Some ( bumped_tx) ;
0 commit comments