@@ -39,7 +39,7 @@ use bitcoin::secp256k1;
39
39
40
40
use ln:: msgs:: DecodeError ;
41
41
use ln:: chan_utils;
42
- use ln:: chan_utils:: { CounterpartyCommitmentSecrets , HTLCOutputInCommitment , HTLCType , ChannelStaticInfo , HolderCommitmentTransactionInfo } ;
42
+ use ln:: chan_utils:: { CounterpartyCommitmentSecrets , HTLCOutputInCommitment , HTLCType , ChannelTransactionParameters , HolderCommitmentTransaction } ;
43
43
use ln:: channelmanager:: { HTLCSource , PaymentPreimage , PaymentHash } ;
44
44
use ln:: onchaintx:: { OnchainTxHandler , InputDescriptors } ;
45
45
use chain:: chaininterface:: { BroadcasterInterface , FeeEstimator } ;
@@ -474,7 +474,7 @@ const MIN_SERIALIZATION_VERSION: u8 = 1;
474
474
#[ derive( Clone ) ]
475
475
pub ( crate ) enum ChannelMonitorUpdateStep {
476
476
LatestHolderCommitmentTXInfo {
477
- commitment_info : HolderCommitmentTransactionInfo ,
477
+ commitment_info : HolderCommitmentTransaction ,
478
478
htlc_outputs : Vec < ( HTLCOutputInCommitment , Option < Signature > , Option < HTLCSource > ) > ,
479
479
} ,
480
480
LatestCounterpartyCommitmentTXInfo {
@@ -936,10 +936,10 @@ impl<ChanSigner: ChannelKeys + Writeable> ChannelMonitor<ChanSigner> {
936
936
impl < ChanSigner : ChannelKeys > ChannelMonitor < ChanSigner > {
937
937
pub ( crate ) fn new ( keys : ChanSigner , shutdown_pubkey : & PublicKey ,
938
938
on_counterparty_tx_csv : u16 , destination_script : & Script , funding_info : ( OutPoint , Script ) ,
939
- channel_static_info : & ChannelStaticInfo ,
939
+ channel_static_info : & ChannelTransactionParameters ,
940
940
funding_redeemscript : Script , channel_value_satoshis : u64 ,
941
941
commitment_transaction_number_obscure_factor : u64 ,
942
- initial_holder_commitment_info : HolderCommitmentTransactionInfo ) -> ChannelMonitor < ChanSigner > {
942
+ initial_holder_commitment_info : HolderCommitmentTransaction ) -> ChannelMonitor < ChanSigner > {
943
943
944
944
assert ! ( commitment_transaction_number_obscure_factor <= ( 1 << 48 ) ) ;
945
945
let our_channel_close_key_hash = WPubkeyHash :: hash ( & shutdown_pubkey. serialize ( ) ) ;
@@ -1133,7 +1133,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
1133
1133
/// is important that any clones of this channel monitor (including remote clones) by kept
1134
1134
/// up-to-date as our holder commitment transaction is updated.
1135
1135
/// Panics if set_on_holder_tx_csv has never been called.
1136
- fn provide_latest_holder_commitment_tx_info ( & mut self , commitment_info : HolderCommitmentTransactionInfo , htlc_outputs : Vec < ( HTLCOutputInCommitment , Option < Signature > , Option < HTLCSource > ) > ) -> Result < ( ) , MonitorUpdateError > {
1136
+ fn provide_latest_holder_commitment_tx_info ( & mut self , commitment_info : HolderCommitmentTransaction , htlc_outputs : Vec < ( HTLCOutputInCommitment , Option < Signature > , Option < HTLCSource > ) > ) -> Result < ( ) , MonitorUpdateError > {
1137
1137
let txid = commitment_info. txid ( & self . onchain_tx_handler . channel_static_info . to_directed ( true ) , & self . secp_ctx ) ;
1138
1138
1139
1139
// block for Rust 1.34 compat
@@ -2506,7 +2506,7 @@ mod tests {
2506
2506
use ln:: channelmanager:: { PaymentPreimage , PaymentHash } ;
2507
2507
use ln:: onchaintx:: { OnchainTxHandler , InputDescriptors } ;
2508
2508
use ln:: chan_utils;
2509
- use ln:: chan_utils:: { HTLCOutputInCommitment , ChannelPublicKeys , ChannelStaticInfo , HolderCommitmentTransactionInfo } ;
2509
+ use ln:: chan_utils:: { HTLCOutputInCommitment , ChannelPublicKeys , ChannelTransactionParameters , HolderCommitmentTransaction } ;
2510
2510
use util:: test_utils:: TestLogger ;
2511
2511
use bitcoin:: secp256k1:: key:: { SecretKey , PublicKey } ;
2512
2512
use bitcoin:: secp256k1:: Secp256k1 ;
@@ -2584,7 +2584,7 @@ mod tests {
2584
2584
delayed_payment_basepoint : PublicKey :: from_secret_key ( & secp_ctx, & SecretKey :: from_slice ( & [ 47 ; 32 ] ) . unwrap ( ) ) ,
2585
2585
htlc_basepoint : PublicKey :: from_secret_key ( & secp_ctx, & SecretKey :: from_slice ( & [ 48 ; 32 ] ) . unwrap ( ) )
2586
2586
} ;
2587
- let channel_static_info = ChannelStaticInfo {
2587
+ let channel_static_info = ChannelTransactionParameters {
2588
2588
holder_pubkeys : keys. holder_channel_pubkeys . clone ( ) ,
2589
2589
counterparty_pubkeys,
2590
2590
holder_selected_contest_delay : 66 ,
@@ -2595,13 +2595,13 @@ mod tests {
2595
2595
// Prune with one old state and a holder commitment tx holding a few overlaps with the
2596
2596
// old state.
2597
2597
let mut monitor = ChannelMonitor :: new ( keys,
2598
- & PublicKey :: from_secret_key ( & secp_ctx, & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ) , 0 , & Script :: new ( ) ,
2599
- ( OutPoint { txid : Txid :: from_slice ( & [ 43 ; 32 ] ) . unwrap ( ) , index : 0 } , Script :: new ( ) ) ,
2600
- & channel_static_info,
2601
- Script :: new ( ) , 46 , 0 ,
2602
- HolderCommitmentTransactionInfo :: dummy ( ) ) ;
2598
+ & PublicKey :: from_secret_key ( & secp_ctx, & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ) , 0 , & Script :: new ( ) ,
2599
+ ( OutPoint { txid : Txid :: from_slice ( & [ 43 ; 32 ] ) . unwrap ( ) , index : 0 } , Script :: new ( ) ) ,
2600
+ & channel_static_info,
2601
+ Script :: new ( ) , 46 , 0 ,
2602
+ HolderCommitmentTransaction :: dummy ( ) ) ;
2603
2603
2604
- monitor. provide_latest_holder_commitment_tx_info ( HolderCommitmentTransactionInfo :: dummy ( ) , preimages_to_holder_htlcs ! ( preimages[ 0 ..10 ] ) ) . unwrap ( ) ;
2604
+ monitor. provide_latest_holder_commitment_tx_info ( HolderCommitmentTransaction :: dummy ( ) , preimages_to_holder_htlcs ! ( preimages[ 0 ..10 ] ) ) . unwrap ( ) ;
2605
2605
monitor. provide_latest_counterparty_commitment_tx_info ( & dummy_tx, preimages_slice_to_htlc_outputs ! ( preimages[ 5 ..15 ] ) , 281474976710655 , dummy_key, & logger) ;
2606
2606
monitor. provide_latest_counterparty_commitment_tx_info ( & dummy_tx, preimages_slice_to_htlc_outputs ! ( preimages[ 15 ..20 ] ) , 281474976710654 , dummy_key, & logger) ;
2607
2607
monitor. provide_latest_counterparty_commitment_tx_info ( & dummy_tx, preimages_slice_to_htlc_outputs ! ( preimages[ 17 ..20 ] ) , 281474976710653 , dummy_key, & logger) ;
@@ -2627,15 +2627,15 @@ mod tests {
2627
2627
2628
2628
// Now update holder commitment tx info, pruning only element 18 as we still care about the
2629
2629
// previous commitment tx's preimages too
2630
- monitor. provide_latest_holder_commitment_tx_info ( HolderCommitmentTransactionInfo :: dummy ( ) , preimages_to_holder_htlcs ! ( preimages[ 0 ..5 ] ) ) . unwrap ( ) ;
2630
+ monitor. provide_latest_holder_commitment_tx_info ( HolderCommitmentTransaction :: dummy ( ) , preimages_to_holder_htlcs ! ( preimages[ 0 ..5 ] ) ) . unwrap ( ) ;
2631
2631
secret[ 0 ..32 ] . clone_from_slice ( & hex:: decode ( "2273e227a5b7449b6e70f1fb4652864038b1cbf9cd7c043a7d6456b7fc275ad8" ) . unwrap ( ) ) ;
2632
2632
monitor. provide_secret ( 281474976710653 , secret. clone ( ) ) . unwrap ( ) ;
2633
2633
assert_eq ! ( monitor. payment_preimages. len( ) , 12 ) ;
2634
2634
test_preimages_exist ! ( & preimages[ 0 ..10 ] , monitor) ;
2635
2635
test_preimages_exist ! ( & preimages[ 18 ..20 ] , monitor) ;
2636
2636
2637
2637
// But if we do it again, we'll prune 5-10
2638
- monitor. provide_latest_holder_commitment_tx_info ( HolderCommitmentTransactionInfo :: dummy ( ) , preimages_to_holder_htlcs ! ( preimages[ 0 ..3 ] ) ) . unwrap ( ) ;
2638
+ monitor. provide_latest_holder_commitment_tx_info ( HolderCommitmentTransaction :: dummy ( ) , preimages_to_holder_htlcs ! ( preimages[ 0 ..3 ] ) ) . unwrap ( ) ;
2639
2639
secret[ 0 ..32 ] . clone_from_slice ( & hex:: decode ( "27cddaa5624534cb6cb9d7da077cf2b22ab21e9b506fd4998a51d54502e99116" ) . unwrap ( ) ) ;
2640
2640
monitor. provide_secret ( 281474976710652 , secret. clone ( ) ) . unwrap ( ) ;
2641
2641
assert_eq ! ( monitor. payment_preimages. len( ) , 5 ) ;
0 commit comments