@@ -122,15 +122,13 @@ pub enum MonitorEvent {
122122 HTLCEvent ( HTLCUpdate ) ,
123123
124124 /// A monitor event that the Channel's commitment transaction was confirmed.
125- CommitmentTxConfirmed ( OutPoint ) ,
125+ CommitmentTxConfirmed ,
126126
127127 /// Indicates a [`ChannelMonitor`] update has completed. See
128128 /// [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
129129 ///
130130 /// [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
131131 UpdateCompleted {
132- /// The funding outpoint of the [`ChannelMonitor`] that was updated
133- funding_txo : OutPoint ,
134132 /// The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
135133 /// [`ChannelMonitor::get_latest_update_id`].
136134 ///
@@ -143,19 +141,18 @@ pub enum MonitorEvent {
143141 /// [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
144142 ///
145143 /// [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
146- UpdateFailed ( OutPoint ) ,
144+ UpdateFailed ,
147145}
148146impl_writeable_tlv_based_enum_upgradable ! ( MonitorEvent ,
149147 // Note that UpdateCompleted and UpdateFailed are currently never serialized to disk as they are
150148 // generated only in ChainMonitor
151- ( 0 , UpdateCompleted ) => {
152- ( 0 , funding_txo, required) ,
153- ( 2 , monitor_update_id, required) ,
149+ ( 1 , UpdateCompleted ) => {
150+ ( 0 , monitor_update_id, required) ,
154151 } ,
152+ ( 3 , CommitmentTxConfirmed ) => { } ,
153+ ( 5 , UpdateFailed ) => { } ,
155154;
156155 ( 2 , HTLCEvent ) ,
157- ( 4 , CommitmentTxConfirmed ) ,
158- ( 6 , UpdateFailed ) ,
159156) ;
160157
161158/// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
@@ -166,14 +163,12 @@ pub struct HTLCUpdate {
166163 pub ( crate ) payment_hash : PaymentHash ,
167164 pub ( crate ) payment_preimage : Option < PaymentPreimage > ,
168165 pub ( crate ) source : HTLCSource ,
169- pub ( crate ) sink_channel_id : Option < [ u8 ; 32 ] > ,
170166 pub ( crate ) onchain_value_satoshis : Option < u64 > ,
171167}
172168impl_writeable_tlv_based ! ( HTLCUpdate , {
173169 ( 0 , payment_hash, required) ,
174170 ( 1 , onchain_value_satoshis, option) ,
175171 ( 2 , source, required) ,
176- ( 3 , sink_channel_id, option) ,
177172 ( 4 , payment_preimage, option) ,
178173} ) ;
179174
@@ -903,7 +898,7 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
903898
904899 writer. write_all ( & ( self . pending_monitor_events . iter ( ) . filter ( |ev| match ev {
905900 MonitorEvent :: HTLCEvent ( _) => true ,
906- MonitorEvent :: CommitmentTxConfirmed ( _ ) => true ,
901+ MonitorEvent :: CommitmentTxConfirmed => true ,
907902 _ => false ,
908903 } ) . count ( ) as u64 ) . to_be_bytes ( ) ) ?;
909904 for event in self . pending_monitor_events . iter ( ) {
@@ -912,7 +907,7 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
912907 0u8 . write ( writer) ?;
913908 upd. write ( writer) ?;
914909 } ,
915- MonitorEvent :: CommitmentTxConfirmed ( _ ) => 1u8 . write ( writer) ?,
910+ MonitorEvent :: CommitmentTxConfirmed => 1u8 . write ( writer) ?,
916911 _ => { } , // Covered in the TLV writes below
917912 }
918913 }
@@ -1893,7 +1888,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
18931888 log_info ! ( logger, "Broadcasting local {}" , log_tx!( tx) ) ;
18941889 broadcaster. broadcast_transaction ( tx) ;
18951890 }
1896- self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxConfirmed ( self . funding_info . 0 ) ) ;
1891+ self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxConfirmed ) ;
18971892 }
18981893
18991894 pub fn update_monitor < B : Deref , F : Deref , L : Deref > ( & mut self , updates : & ChannelMonitorUpdate , broadcaster : & B , fee_estimator : & F , logger : & L ) -> Result < ( ) , ( ) >
@@ -2483,7 +2478,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
24832478 let funding_outp = HolderFundingOutput :: build ( self . funding_redeemscript . clone ( ) ) ;
24842479 let commitment_package = PackageTemplate :: build_package ( self . funding_info . 0 . txid . clone ( ) , self . funding_info . 0 . index as u32 , PackageSolvingData :: HolderFundingOutput ( funding_outp) , self . best_block . height ( ) , false , self . best_block . height ( ) ) ;
24852480 claimable_outpoints. push ( commitment_package) ;
2486- self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxConfirmed ( self . funding_info . 0 ) ) ;
2481+ self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxConfirmed ) ;
24872482 let commitment_tx = self . onchain_tx_handler . get_fully_signed_holder_tx ( & self . funding_redeemscript ) ;
24882483 self . holder_tx_signed = true ;
24892484 // Because we're broadcasting a commitment transaction, we should construct the package
@@ -2547,7 +2542,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
25472542 payment_preimage : None ,
25482543 source : source. clone ( ) ,
25492544 onchain_value_satoshis,
2550- sink_channel_id : Some ( self . funding_info . 0 . to_channel_id ( ) ) ,
25512545 } ) ) ;
25522546 if let Some ( idx) = input_idx {
25532547 self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { input_idx : idx, payment_preimage : None } ) ;
@@ -2887,7 +2881,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
28872881 payment_preimage : Some ( payment_preimage) ,
28882882 payment_hash,
28892883 onchain_value_satoshis : Some ( amount_msat / 1000 ) ,
2890- sink_channel_id : Some ( self . funding_info . 0 . to_channel_id ( ) ) ,
28912884 } ) ) ;
28922885 }
28932886 } else if offered_preimage_claim {
@@ -2909,7 +2902,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
29092902 payment_preimage : Some ( payment_preimage) ,
29102903 payment_hash,
29112904 onchain_value_satoshis : Some ( amount_msat / 1000 ) ,
2912- sink_channel_id : Some ( self . funding_info . 0 . to_channel_id ( ) ) ,
29132905 } ) ) ;
29142906 }
29152907 } else {
@@ -3195,7 +3187,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
31953187 for _ in 0 ..pending_monitor_events_len {
31963188 let ev = match <u8 as Readable >:: read ( reader) ? {
31973189 0 => MonitorEvent :: HTLCEvent ( Readable :: read ( reader) ?) ,
3198- 1 => MonitorEvent :: CommitmentTxConfirmed ( funding_info . 0 ) ,
3190+ 1 => MonitorEvent :: CommitmentTxConfirmed ,
31993191 _ => return Err ( DecodeError :: InvalidValue )
32003192 } ;
32013193 pending_monitor_events. as_mut ( ) . unwrap ( ) . push ( ev) ;
0 commit comments