@@ -533,10 +533,10 @@ pub(crate) struct WatchtowerPersister {
533533 /// ChannelMonitorUpdateStep::LatestCounterpartyCommitmentTxInfo. We'll store the justice tx
534534 /// amount, and commitment number so we can build the justice tx after our counterparty
535535 /// revokes it.
536- unsigned_justice_tx_data : Mutex < HashMap < OutPoint , VecDeque < JusticeTxData > > > ,
536+ unsigned_justice_tx_data : Mutex < HashMap < ChannelId , VecDeque < JusticeTxData > > > ,
537537 /// After receiving a revoke_and_ack for a commitment number, we'll form and store the justice
538538 /// 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 > > > ,
540540 destination_script : ScriptBuf ,
541541}
542542
@@ -556,12 +556,12 @@ impl WatchtowerPersister {
556556
557557 #[ cfg( test) ]
558558 pub ( crate ) fn justice_tx (
559- & self , funding_txo : OutPoint , commitment_txid : & Txid ,
559+ & self , channel_id : ChannelId , commitment_txid : & Txid ,
560560 ) -> Option < Transaction > {
561561 self . watchtower_state
562562 . lock ( )
563563 . unwrap ( )
564- . get ( & funding_txo )
564+ . get ( & channel_id )
565565 . unwrap ( )
566566 . get ( commitment_txid)
567567 . cloned ( )
@@ -596,13 +596,13 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
596596 . unsigned_justice_tx_data
597597 . lock( )
598598 . unwrap( )
599- . insert( funding_txo , VecDeque :: new( ) )
599+ . insert( data . channel_id ( ) , VecDeque :: new( ) )
600600 . is_none( ) ) ;
601601 assert ! ( self
602602 . watchtower_state
603603 . lock( )
604604 . unwrap( )
605- . insert( funding_txo , new_hash_map( ) )
605+ . insert( data . channel_id ( ) , new_hash_map( ) )
606606 . is_none( ) ) ;
607607
608608 let initial_counterparty_commitment_tx =
@@ -613,7 +613,7 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
613613 self . unsigned_justice_tx_data
614614 . lock ( )
615615 . unwrap ( )
616- . get_mut ( & funding_txo )
616+ . get_mut ( & data . channel_id ( ) )
617617 . unwrap ( )
618618 . push_back ( justice_data) ;
619619 }
@@ -632,7 +632,7 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
632632 . into_iter ( )
633633 . filter_map ( |commitment_tx| self . form_justice_data_from_commitment ( & commitment_tx) ) ;
634634 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 ( ) ;
636636 channel_state. extend ( justice_datas) ;
637637
638638 while let Some ( JusticeTxData { justice_tx, value, commitment_number } ) =
@@ -651,7 +651,7 @@ impl<Signer: sign::ecdsa::EcdsaChannelSigner> Persist<Signer> for WatchtowerPers
651651 . watchtower_state
652652 . lock ( )
653653 . unwrap ( )
654- . get_mut ( & funding_txo )
654+ . get_mut ( & data . channel_id ( ) )
655655 . unwrap ( )
656656 . insert ( commitment_txid, signed_justice_tx) ;
657657 assert ! ( dup. is_none( ) ) ;
0 commit comments