@@ -533,10 +533,10 @@ pub(crate) struct WatchtowerPersister {
533
533
/// ChannelMonitorUpdateStep::LatestCounterpartyCommitmentTxInfo. We'll store the justice tx
534
534
/// amount, and commitment number so we can build the justice tx after our counterparty
535
535
/// revokes it.
536
- unsigned_justice_tx_data : Mutex < HashMap < OutPoint , VecDeque < JusticeTxData > > > ,
536
+ unsigned_justice_tx_data : Mutex < HashMap < ChannelId , VecDeque < JusticeTxData > > > ,
537
537
/// After receiving a revoke_and_ack for a commitment number, we'll form and store the justice
538
538
/// tx which would be used to provide a watchtower with the data it needs.
539
- watchtower_state : Mutex < HashMap < OutPoint , HashMap < Txid , Transaction > > > ,
539
+ watchtower_state : Mutex < HashMap < ChannelId , HashMap < Txid , Transaction > > > ,
540
540
destination_script : ScriptBuf ,
541
541
}
542
542
@@ -556,12 +556,12 @@ impl WatchtowerPersister {
556
556
557
557
#[ cfg( test) ]
558
558
pub ( crate ) fn justice_tx (
559
- & self , funding_txo : OutPoint , commitment_txid : & Txid ,
559
+ & self , channel_id : ChannelId , commitment_txid : & Txid ,
560
560
) -> Option < Transaction > {
561
561
self . watchtower_state
562
562
. lock ( )
563
563
. unwrap ( )
564
- . get ( & funding_txo )
564
+ . get ( & channel_id )
565
565
. unwrap ( )
566
566
. get ( commitment_txid)
567
567
. cloned ( )
@@ -596,13 +596,13 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
596
596
. unsigned_justice_tx_data
597
597
. lock( )
598
598
. unwrap( )
599
- . insert( funding_txo , VecDeque :: new( ) )
599
+ . insert( data . channel_id ( ) , VecDeque :: new( ) )
600
600
. is_none( ) ) ;
601
601
assert ! ( self
602
602
. watchtower_state
603
603
. lock( )
604
604
. unwrap( )
605
- . insert( funding_txo , new_hash_map( ) )
605
+ . insert( data . channel_id ( ) , new_hash_map( ) )
606
606
. is_none( ) ) ;
607
607
608
608
let initial_counterparty_commitment_tx =
@@ -613,7 +613,7 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
613
613
self . unsigned_justice_tx_data
614
614
. lock ( )
615
615
. unwrap ( )
616
- . get_mut ( & funding_txo )
616
+ . get_mut ( & data . channel_id ( ) )
617
617
. unwrap ( )
618
618
. push_back ( justice_data) ;
619
619
}
@@ -632,7 +632,7 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
632
632
. into_iter ( )
633
633
. filter_map ( |commitment_tx| self . form_justice_data_from_commitment ( & commitment_tx) ) ;
634
634
let mut channels_justice_txs = self . unsigned_justice_tx_data . lock ( ) . unwrap ( ) ;
635
- let channel_state = channels_justice_txs. get_mut ( & funding_txo ) . unwrap ( ) ;
635
+ let channel_state = channels_justice_txs. get_mut ( & data . channel_id ( ) ) . unwrap ( ) ;
636
636
channel_state. extend ( justice_datas) ;
637
637
638
638
while let Some ( JusticeTxData { justice_tx, value, commitment_number } ) =
@@ -651,7 +651,7 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
651
651
. watchtower_state
652
652
. lock ( )
653
653
. unwrap ( )
654
- . get_mut ( & funding_txo )
654
+ . get_mut ( & data . channel_id ( ) )
655
655
. unwrap ( )
656
656
. insert ( commitment_txid, signed_justice_tx) ;
657
657
assert ! ( dup. is_none( ) ) ;
0 commit comments