@@ -555,15 +555,15 @@ impl Channel {
555
555
if htlc. amount_msat / 1000 >= dust_limit_satoshis + ( self . feerate_per_kw * HTLC_TIMEOUT_TX_WEIGHT / 1000 ) {
556
556
let htlc_in_tx = htlc. get_in_commitment ( true ) ;
557
557
txouts. push ( ( TxOut {
558
- script_pubkey : chan_utils:: get_htlc_redeemscript ( & htlc_in_tx, & keys, true ) . to_v0_p2wsh ( ) ,
558
+ script_pubkey : chan_utils:: get_htlc_redeemscript ( & htlc_in_tx, & keys) . to_v0_p2wsh ( ) ,
559
559
value : htlc. amount_msat / 1000
560
560
} , Some ( htlc_in_tx) ) ) ;
561
561
}
562
562
} else {
563
563
if htlc. amount_msat / 1000 >= dust_limit_satoshis + ( self . feerate_per_kw * HTLC_SUCCESS_TX_WEIGHT / 1000 ) {
564
564
let htlc_in_tx = htlc. get_in_commitment ( false ) ;
565
565
txouts. push ( ( TxOut { // "received HTLC output"
566
- script_pubkey : chan_utils:: get_htlc_redeemscript ( & htlc_in_tx, & keys, false ) . to_v0_p2wsh ( ) ,
566
+ script_pubkey : chan_utils:: get_htlc_redeemscript ( & htlc_in_tx, & keys) . to_v0_p2wsh ( ) ,
567
567
value : htlc. amount_msat / 1000
568
568
} , Some ( htlc_in_tx) ) ) ;
569
569
}
@@ -812,7 +812,7 @@ impl Channel {
812
812
panic ! ( "Tried to re-sign HTLC transaction" ) ;
813
813
}
814
814
815
- let htlc_redeemscript = chan_utils:: get_htlc_redeemscript ( & htlc, & keys, htlc . offered ) ;
815
+ let htlc_redeemscript = chan_utils:: get_htlc_redeemscript ( & htlc, & keys) ;
816
816
817
817
let our_htlc_key = secp_derived_key ! ( chan_utils:: derive_private_key( & self . secp_ctx, & keys. per_commitment_point, & self . local_keys. htlc_base_key) ) ;
818
818
let sighash = Message :: from_slice ( & bip143:: SighashComponents :: new ( & tx) . sighash_all ( & tx. input [ 0 ] , & htlc_redeemscript, htlc. amount_msat / 1000 ) [ ..] ) . unwrap ( ) ;
@@ -1274,7 +1274,7 @@ impl Channel {
1274
1274
1275
1275
for ( idx, ref htlc) in local_commitment_tx. 1 . iter ( ) . enumerate ( ) {
1276
1276
let htlc_tx = self . build_htlc_transaction ( & local_commitment_txid, htlc, true , & local_keys) ?;
1277
- let htlc_redeemscript = chan_utils:: get_htlc_redeemscript ( & htlc, & local_keys, htlc . offered ) ;
1277
+ let htlc_redeemscript = chan_utils:: get_htlc_redeemscript ( & htlc, & local_keys) ;
1278
1278
let htlc_sighash = Message :: from_slice ( & bip143:: SighashComponents :: new ( & htlc_tx) . sighash_all ( & htlc_tx. input [ 0 ] , & htlc_redeemscript, htlc. amount_msat / 1000 ) [ ..] ) . unwrap ( ) ;
1279
1279
secp_call ! ( self . secp_ctx. verify( & htlc_sighash, & msg. htlc_signatures[ idx] , & local_keys. b_htlc_key) , "Invalid HTLC tx siganture from peer" ) ;
1280
1280
}
@@ -1935,7 +1935,7 @@ impl Channel {
1935
1935
1936
1936
for ref htlc in remote_commitment_tx. 1 . iter ( ) {
1937
1937
let htlc_tx = self . build_htlc_transaction ( & remote_commitment_txid, htlc, false , & remote_keys) ?;
1938
- let htlc_redeemscript = chan_utils:: get_htlc_redeemscript ( & htlc, & remote_keys, htlc . offered ) ;
1938
+ let htlc_redeemscript = chan_utils:: get_htlc_redeemscript ( & htlc, & remote_keys) ;
1939
1939
let htlc_sighash = Message :: from_slice ( & bip143:: SighashComponents :: new ( & htlc_tx) . sighash_all ( & htlc_tx. input [ 0 ] , & htlc_redeemscript, htlc. amount_msat / 1000 ) [ ..] ) . unwrap ( ) ;
1940
1940
let our_htlc_key = secp_derived_key ! ( chan_utils:: derive_private_key( & self . secp_ctx, & remote_keys. per_commitment_point, & self . local_keys. htlc_base_key) ) ;
1941
1941
htlc_sigs. push ( self . secp_ctx . sign ( & htlc_sighash, & our_htlc_key) . unwrap ( ) ) ;
@@ -2090,7 +2090,7 @@ mod tests {
2090
2090
2091
2091
let ref htlc = unsigned_tx. 1 [ $htlc_idx] ;
2092
2092
let mut htlc_tx = chan. build_htlc_transaction( & unsigned_tx. 0 . txid( ) , & htlc, true , & keys) . unwrap( ) ;
2093
- let htlc_redeemscript = chan_utils:: get_htlc_redeemscript( & htlc, & keys, htlc . offered ) ;
2093
+ let htlc_redeemscript = chan_utils:: get_htlc_redeemscript( & htlc, & keys) ;
2094
2094
let htlc_sighash = Message :: from_slice( & bip143:: SighashComponents :: new( & htlc_tx) . sighash_all( & htlc_tx. input[ 0 ] , & htlc_redeemscript, htlc. amount_msat / 1000 ) [ ..] ) . unwrap( ) ;
2095
2095
secp_ctx. verify( & htlc_sighash, & remote_signature, & keys. b_htlc_key) . unwrap( ) ;
2096
2096
0 commit comments