@@ -1095,10 +1095,10 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
10951095 fn build_local_transaction_keys ( & self , commitment_number : u64 ) -> Result < TxCreationKeys , ChannelError > {
10961096 let per_commitment_point = PublicKey :: from_secret_key ( & self . secp_ctx , & self . build_local_commitment_secret ( commitment_number) ) ;
10971097 let delayed_payment_base = & self . local_keys . pubkeys ( ) . delayed_payment_basepoint ;
1098- let htlc_basepoint = PublicKey :: from_secret_key ( & self . secp_ctx , self . local_keys . htlc_base_key ( ) ) ;
1098+ let htlc_basepoint = & self . local_keys . pubkeys ( ) . htlc_basepoint ;
10991099 let their_pubkeys = self . their_pubkeys . as_ref ( ) . unwrap ( ) ;
11001100
1101- Ok ( secp_check ! ( TxCreationKeys :: new( & self . secp_ctx, & per_commitment_point, delayed_payment_base, & htlc_basepoint, & their_pubkeys. revocation_basepoint, & their_pubkeys. htlc_basepoint) , "Local tx keys generation got bogus keys" ) )
1101+ Ok ( secp_check ! ( TxCreationKeys :: new( & self . secp_ctx, & per_commitment_point, delayed_payment_base, htlc_basepoint, & their_pubkeys. revocation_basepoint, & their_pubkeys. htlc_basepoint) , "Local tx keys generation got bogus keys" ) )
11021102 }
11031103
11041104 #[ inline]
@@ -1109,10 +1109,10 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
11091109 //TODO: Ensure that the payment_key derived here ends up in the library users' wallet as we
11101110 //may see payments to it!
11111111 let revocation_basepoint = & self . local_keys . pubkeys ( ) . revocation_basepoint ;
1112- let htlc_basepoint = PublicKey :: from_secret_key ( & self . secp_ctx , self . local_keys . htlc_base_key ( ) ) ;
1112+ let htlc_basepoint = & self . local_keys . pubkeys ( ) . htlc_basepoint ;
11131113 let their_pubkeys = self . their_pubkeys . as_ref ( ) . unwrap ( ) ;
11141114
1115- Ok ( secp_check ! ( TxCreationKeys :: new( & self . secp_ctx, & self . their_cur_commitment_point. unwrap( ) , & their_pubkeys. delayed_payment_basepoint, & their_pubkeys. htlc_basepoint, revocation_basepoint, & htlc_basepoint) , "Remote tx keys generation got bogus keys" ) )
1115+ Ok ( secp_check ! ( TxCreationKeys :: new( & self . secp_ctx, & self . their_cur_commitment_point. unwrap( ) , & their_pubkeys. delayed_payment_basepoint, & their_pubkeys. htlc_basepoint, revocation_basepoint, htlc_basepoint) , "Remote tx keys generation got bogus keys" ) )
11161116 }
11171117
11181118 /// Gets the redeemscript for the funding transaction output (ie the funding transaction output
@@ -3317,7 +3317,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
33173317 revocation_basepoint : self . local_keys . pubkeys ( ) . revocation_basepoint ,
33183318 payment_point : self . local_keys . pubkeys ( ) . payment_point ,
33193319 delayed_payment_basepoint : self . local_keys . pubkeys ( ) . delayed_payment_basepoint ,
3320- htlc_basepoint : PublicKey :: from_secret_key ( & self . secp_ctx , self . local_keys . htlc_base_key ( ) ) ,
3320+ htlc_basepoint : self . local_keys . pubkeys ( ) . htlc_basepoint ,
33213321 first_per_commitment_point : PublicKey :: from_secret_key ( & self . secp_ctx , & local_commitment_secret) ,
33223322 channel_flags : if self . config . announced_channel { 1 } else { 0 } ,
33233323 shutdown_scriptpubkey : OptionalField :: Present ( if self . config . commit_upfront_shutdown_pubkey { self . get_closing_scriptpubkey ( ) } else { Builder :: new ( ) . into_script ( ) } )
@@ -3350,7 +3350,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
33503350 revocation_basepoint : self . local_keys . pubkeys ( ) . revocation_basepoint ,
33513351 payment_point : self . local_keys . pubkeys ( ) . payment_point ,
33523352 delayed_payment_basepoint : self . local_keys . pubkeys ( ) . delayed_payment_basepoint ,
3353- htlc_basepoint : PublicKey :: from_secret_key ( & self . secp_ctx , self . local_keys . htlc_base_key ( ) ) ,
3353+ htlc_basepoint : self . local_keys . pubkeys ( ) . htlc_basepoint ,
33543354 first_per_commitment_point : PublicKey :: from_secret_key ( & self . secp_ctx , & local_commitment_secret) ,
33553355 shutdown_scriptpubkey : OptionalField :: Present ( if self . config . commit_upfront_shutdown_pubkey { self . get_closing_scriptpubkey ( ) } else { Builder :: new ( ) . into_script ( ) } )
33563356 }
@@ -4477,8 +4477,8 @@ mod tests {
44774477 let delayed_payment_base = & chan. local_keys . pubkeys ( ) . delayed_payment_basepoint ;
44784478 let per_commitment_secret = SecretKey :: from_slice ( & hex:: decode ( "1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100" ) . unwrap ( ) [ ..] ) . unwrap ( ) ;
44794479 let per_commitment_point = PublicKey :: from_secret_key ( & secp_ctx, & per_commitment_secret) ;
4480- let htlc_basepoint = PublicKey :: from_secret_key ( & secp_ctx , chan. local_keys . htlc_base_key ( ) ) ;
4481- let keys = TxCreationKeys :: new ( & secp_ctx, & per_commitment_point, delayed_payment_base, & htlc_basepoint, & their_pubkeys. revocation_basepoint , & their_pubkeys. htlc_basepoint ) . unwrap ( ) ;
4480+ let htlc_basepoint = & chan. local_keys . pubkeys ( ) . htlc_basepoint ;
4481+ let keys = TxCreationKeys :: new ( & secp_ctx, & per_commitment_point, delayed_payment_base, htlc_basepoint, & their_pubkeys. revocation_basepoint , & their_pubkeys. htlc_basepoint ) . unwrap ( ) ;
44824482
44834483 chan. their_pubkeys = Some ( their_pubkeys) ;
44844484
0 commit comments