@@ -122,15 +122,13 @@ pub enum MonitorEvent {
122
122
HTLCEvent ( HTLCUpdate ) ,
123
123
124
124
/// A monitor event that the Channel's commitment transaction was confirmed.
125
- CommitmentTxConfirmed ( OutPoint ) ,
125
+ CommitmentTxConfirmed ,
126
126
127
127
/// Indicates a [`ChannelMonitor`] update has completed. See
128
128
/// [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
129
129
///
130
130
/// [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
131
131
UpdateCompleted {
132
- /// The funding outpoint of the [`ChannelMonitor`] that was updated
133
- funding_txo : OutPoint ,
134
132
/// The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
135
133
/// [`ChannelMonitor::get_latest_update_id`].
136
134
///
@@ -143,19 +141,18 @@ pub enum MonitorEvent {
143
141
/// [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
144
142
///
145
143
/// [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
146
- UpdateFailed ( OutPoint ) ,
144
+ UpdateFailed ,
147
145
}
148
146
impl_writeable_tlv_based_enum_upgradable ! ( MonitorEvent ,
149
147
// Note that UpdateCompleted and UpdateFailed are currently never serialized to disk as they are
150
148
// 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) ,
154
151
} ,
152
+ ( 3 , CommitmentTxConfirmed ) => { } ,
153
+ ( 5 , UpdateFailed ) => { } ,
155
154
;
156
155
( 2 , HTLCEvent ) ,
157
- ( 4 , CommitmentTxConfirmed ) ,
158
- ( 6 , UpdateFailed ) ,
159
156
) ;
160
157
161
158
/// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
@@ -166,14 +163,12 @@ pub struct HTLCUpdate {
166
163
pub ( crate ) payment_hash : PaymentHash ,
167
164
pub ( crate ) payment_preimage : Option < PaymentPreimage > ,
168
165
pub ( crate ) source : HTLCSource ,
169
- pub ( crate ) sink_channel_id : Option < [ u8 ; 32 ] > ,
170
166
pub ( crate ) onchain_value_satoshis : Option < u64 > ,
171
167
}
172
168
impl_writeable_tlv_based ! ( HTLCUpdate , {
173
169
( 0 , payment_hash, required) ,
174
170
( 1 , onchain_value_satoshis, option) ,
175
171
( 2 , source, required) ,
176
- ( 3 , sink_channel_id, option) ,
177
172
( 4 , payment_preimage, option) ,
178
173
} ) ;
179
174
@@ -903,7 +898,7 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
903
898
904
899
writer. write_all ( & ( self . pending_monitor_events . iter ( ) . filter ( |ev| match ev {
905
900
MonitorEvent :: HTLCEvent ( _) => true ,
906
- MonitorEvent :: CommitmentTxConfirmed ( _ ) => true ,
901
+ MonitorEvent :: CommitmentTxConfirmed => true ,
907
902
_ => false ,
908
903
} ) . count ( ) as u64 ) . to_be_bytes ( ) ) ?;
909
904
for event in self . pending_monitor_events . iter ( ) {
@@ -912,7 +907,7 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
912
907
0u8 . write ( writer) ?;
913
908
upd. write ( writer) ?;
914
909
} ,
915
- MonitorEvent :: CommitmentTxConfirmed ( _ ) => 1u8 . write ( writer) ?,
910
+ MonitorEvent :: CommitmentTxConfirmed => 1u8 . write ( writer) ?,
916
911
_ => { } , // Covered in the TLV writes below
917
912
}
918
913
}
@@ -1893,7 +1888,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1893
1888
log_info ! ( logger, "Broadcasting local {}" , log_tx!( tx) ) ;
1894
1889
broadcaster. broadcast_transaction ( tx) ;
1895
1890
}
1896
- self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxConfirmed ( self . funding_info . 0 ) ) ;
1891
+ self . pending_monitor_events . push ( MonitorEvent :: CommitmentTxConfirmed ) ;
1897
1892
}
1898
1893
1899
1894
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> {
2483
2478
let funding_outp = HolderFundingOutput :: build ( self . funding_redeemscript . clone ( ) ) ;
2484
2479
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 ( ) ) ;
2485
2480
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 ) ;
2487
2482
let commitment_tx = self . onchain_tx_handler . get_fully_signed_holder_tx ( & self . funding_redeemscript ) ;
2488
2483
self . holder_tx_signed = true ;
2489
2484
// Because we're broadcasting a commitment transaction, we should construct the package
@@ -2547,7 +2542,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2547
2542
payment_preimage : None ,
2548
2543
source : source. clone ( ) ,
2549
2544
onchain_value_satoshis,
2550
- sink_channel_id : Some ( self . funding_info . 0 . to_channel_id ( ) ) ,
2551
2545
} ) ) ;
2552
2546
if let Some ( idx) = input_idx {
2553
2547
self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { input_idx : idx, payment_preimage : None } ) ;
@@ -2887,7 +2881,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2887
2881
payment_preimage : Some ( payment_preimage) ,
2888
2882
payment_hash,
2889
2883
onchain_value_satoshis : Some ( amount_msat / 1000 ) ,
2890
- sink_channel_id : Some ( self . funding_info . 0 . to_channel_id ( ) ) ,
2891
2884
} ) ) ;
2892
2885
}
2893
2886
} else if offered_preimage_claim {
@@ -2909,7 +2902,6 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2909
2902
payment_preimage : Some ( payment_preimage) ,
2910
2903
payment_hash,
2911
2904
onchain_value_satoshis : Some ( amount_msat / 1000 ) ,
2912
- sink_channel_id : Some ( self . funding_info . 0 . to_channel_id ( ) ) ,
2913
2905
} ) ) ;
2914
2906
}
2915
2907
} else {
@@ -3195,7 +3187,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
3195
3187
for _ in 0 ..pending_monitor_events_len {
3196
3188
let ev = match <u8 as Readable >:: read ( reader) ? {
3197
3189
0 => MonitorEvent :: HTLCEvent ( Readable :: read ( reader) ?) ,
3198
- 1 => MonitorEvent :: CommitmentTxConfirmed ( funding_info . 0 ) ,
3190
+ 1 => MonitorEvent :: CommitmentTxConfirmed ,
3199
3191
_ => return Err ( DecodeError :: InvalidValue )
3200
3192
} ;
3201
3193
pending_monitor_events. as_mut ( ) . unwrap ( ) . push ( ev) ;
0 commit comments