@@ -159,7 +159,7 @@ pub trait Persist<ChannelSigner: WriteableEcdsaChannelSigner> {
159
159
///
160
160
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
161
161
/// [`Writeable::write`]: crate::util::ser::Writeable::write
162
- fn persist_new_channel ( & self , channel_funding_outpoint : OutPoint , channel_id : ChannelId , data : & ChannelMonitor < ChannelSigner > , update_id : MonitorUpdateId ) -> ChannelMonitorUpdateStatus ;
162
+ fn persist_new_channel ( & self , channel_funding_outpoint : OutPoint , data : & ChannelMonitor < ChannelSigner > , update_id : MonitorUpdateId ) -> ChannelMonitorUpdateStatus ;
163
163
164
164
/// Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
165
165
/// update.
@@ -194,7 +194,7 @@ pub trait Persist<ChannelSigner: WriteableEcdsaChannelSigner> {
194
194
/// [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
195
195
///
196
196
/// [`Writeable::write`]: crate::util::ser::Writeable::write
197
- fn update_persisted_channel ( & self , channel_funding_outpoint : OutPoint , channel_id : ChannelId , update : Option < & ChannelMonitorUpdate > , data : & ChannelMonitor < ChannelSigner > , update_id : MonitorUpdateId ) -> ChannelMonitorUpdateStatus ;
197
+ fn update_persisted_channel ( & self , channel_funding_outpoint : OutPoint , update : Option < & ChannelMonitorUpdate > , data : & ChannelMonitor < ChannelSigner > , update_id : MonitorUpdateId ) -> ChannelMonitorUpdateStatus ;
198
198
}
199
199
200
200
struct MonitorHolder < ChannelSigner : WriteableEcdsaChannelSigner > {
@@ -322,8 +322,7 @@ where C::Target: chain::Filter,
322
322
for funding_outpoint in funding_outpoints. iter ( ) {
323
323
let monitor_lock = self . monitors . read ( ) . unwrap ( ) ;
324
324
if let Some ( monitor_state) = monitor_lock. get ( funding_outpoint) {
325
- let channel_id = monitor_state. monitor . get_channel_id ( ) ;
326
- if self . update_monitor_with_chain_data ( header, best_height, txdata, & process, funding_outpoint, channel_id, & monitor_state) . is_err ( ) {
325
+ if self . update_monitor_with_chain_data ( header, best_height, txdata, & process, funding_outpoint, & monitor_state) . is_err ( ) {
327
326
// Take the monitors lock for writing so that we poison it and any future
328
327
// operations going forward fail immediately.
329
328
core:: mem:: drop ( monitor_lock) ;
@@ -338,8 +337,7 @@ where C::Target: chain::Filter,
338
337
let monitor_states = self . monitors . write ( ) . unwrap ( ) ;
339
338
for ( funding_outpoint, monitor_state) in monitor_states. iter ( ) {
340
339
if !funding_outpoints. contains ( funding_outpoint) {
341
- let channel_id = monitor_state. monitor . get_channel_id ( ) ;
342
- if self . update_monitor_with_chain_data ( header, best_height, txdata, & process, funding_outpoint, channel_id, & monitor_state) . is_err ( ) {
340
+ if self . update_monitor_with_chain_data ( header, best_height, txdata, & process, funding_outpoint, & monitor_state) . is_err ( ) {
343
341
log_error ! ( self . logger, "{}" , err_str) ;
344
342
panic ! ( "{}" , err_str) ;
345
343
}
@@ -359,7 +357,7 @@ where C::Target: chain::Filter,
359
357
360
358
fn update_monitor_with_chain_data < FN > (
361
359
& self , header : & Header , best_height : Option < u32 > , txdata : & TransactionData ,
362
- process : FN , funding_outpoint : & OutPoint , channel_id : ChannelId , monitor_state : & MonitorHolder < ChannelSigner >
360
+ process : FN , funding_outpoint : & OutPoint , monitor_state : & MonitorHolder < ChannelSigner >
363
361
) -> Result < ( ) , ( ) > where FN : Fn ( & ChannelMonitor < ChannelSigner > , & TransactionData ) -> Vec < TransactionOutputs > {
364
362
let monitor = & monitor_state. monitor ;
365
363
let logger = WithChannelMonitor :: from ( & self . logger , & monitor) ;
@@ -380,7 +378,7 @@ where C::Target: chain::Filter,
380
378
}
381
379
382
380
log_trace ! ( logger, "Syncing Channel Monitor for channel {}" , log_funding_info!( monitor) ) ;
383
- match self . persister . update_persisted_channel ( * funding_outpoint, channel_id , None , monitor, update_id) {
381
+ match self . persister . update_persisted_channel ( * funding_outpoint, None , monitor, update_id) {
384
382
ChannelMonitorUpdateStatus :: Completed =>
385
383
log_trace ! ( logger, "Finished syncing Channel Monitor for channel {}" , log_funding_info!( monitor) ) ,
386
384
ChannelMonitorUpdateStatus :: InProgress => {
@@ -733,7 +731,7 @@ where C::Target: chain::Filter,
733
731
log_trace ! ( logger, "Got new ChannelMonitor for channel {}" , log_funding_info!( monitor) ) ;
734
732
let update_id = MonitorUpdateId :: from_new_monitor ( & monitor) ;
735
733
let mut pending_monitor_updates = Vec :: new ( ) ;
736
- let persist_res = self . persister . persist_new_channel ( funding_outpoint, monitor . get_channel_id ( ) , & monitor, update_id) ;
734
+ let persist_res = self . persister . persist_new_channel ( funding_outpoint, & monitor, update_id) ;
737
735
match persist_res {
738
736
ChannelMonitorUpdateStatus :: InProgress => {
739
737
log_info ! ( logger, "Persistence of new ChannelMonitor for channel {} in progress" , log_funding_info!( monitor) ) ;
@@ -790,9 +788,9 @@ where C::Target: chain::Filter,
790
788
// while reading `channel_monitor` with updates from storage. Instead, we should persist
791
789
// the entire `channel_monitor` here.
792
790
log_warn ! ( logger, "Failed to update ChannelMonitor for channel {}. Going ahead and persisting the entire ChannelMonitor" , log_funding_info!( monitor) ) ;
793
- self . persister . update_persisted_channel ( funding_txo, channel_id , None , monitor, update_id)
791
+ self . persister . update_persisted_channel ( funding_txo, None , monitor, update_id)
794
792
} else {
795
- self . persister . update_persisted_channel ( funding_txo, channel_id , Some ( update) , monitor, update_id)
793
+ self . persister . update_persisted_channel ( funding_txo, Some ( update) , monitor, update_id)
796
794
} ;
797
795
match persist_res {
798
796
ChannelMonitorUpdateStatus :: InProgress => {
0 commit comments