@@ -526,7 +526,7 @@ where C::Target: chain::Filter,
526
526
pending_monitor_updates. retain ( |update_id| * update_id != completed_update_id) ;
527
527
528
528
match completed_update_id {
529
- MonitorUpdateId { contents : UpdateOrigin :: OffChain ( _ ) } => {
529
+ MonitorUpdateId { contents : UpdateOrigin :: OffChain ( completed_update_id ) } => {
530
530
// Note that we only check for `UpdateOrigin::OffChain` failures here - if
531
531
// we're being told that a `UpdateOrigin::OffChain` monitor update completed,
532
532
// we only care about ensuring we don't tell the `ChannelManager` to restore
@@ -537,6 +537,14 @@ where C::Target: chain::Filter,
537
537
// `MonitorEvent`s from the monitor back to the `ChannelManager` until they
538
538
// complete.
539
539
let monitor_is_pending_updates = monitor_data. has_pending_offchain_updates ( & pending_monitor_updates) ;
540
+ log_debug ! ( self . logger, "Completed off-chain monitor update {} for channel with funding outpoint {:?}, {}" ,
541
+ completed_update_id,
542
+ funding_txo,
543
+ if monitor_is_pending_updates {
544
+ "still have pending off-chain updates"
545
+ } else {
546
+ "all off-chain updates complete, returning a MonitorEvent"
547
+ } ) ;
540
548
if monitor_is_pending_updates {
541
549
// If there are still monitor updates pending, we cannot yet construct a
542
550
// Completed event.
@@ -548,7 +556,16 @@ where C::Target: chain::Filter,
548
556
} ] , monitor_data. monitor . get_counterparty_node_id ( ) ) ) ;
549
557
} ,
550
558
MonitorUpdateId { contents : UpdateOrigin :: ChainSync ( _) } => {
551
- if !monitor_data. has_pending_chainsync_updates ( & pending_monitor_updates) {
559
+ let monitor_has_pending_updates =
560
+ monitor_data. has_pending_chainsync_updates ( & pending_monitor_updates) ;
561
+ log_debug ! ( self . logger, "Completed chain sync monitor update for channel with funding outpoint {:?}, {}" ,
562
+ funding_txo,
563
+ if monitor_has_pending_updates {
564
+ "still have pending chain sync updates"
565
+ } else {
566
+ "all chain sync updates complete, releasing pending MonitorEvents"
567
+ } ) ;
568
+ if !monitor_has_pending_updates {
552
569
monitor_data. last_chain_persist_height . store ( self . highest_chain_height . load ( Ordering :: Acquire ) , Ordering :: Release ) ;
553
570
// The next time release_pending_monitor_events is called, any events for this
554
571
// ChannelMonitor will be returned.
@@ -771,7 +788,7 @@ where C::Target: chain::Filter,
771
788
Some ( monitor_state) => {
772
789
let monitor = & monitor_state. monitor ;
773
790
let logger = WithChannelMonitor :: from ( & self . logger , & monitor) ;
774
- log_trace ! ( logger, "Updating ChannelMonitor for channel {}" , log_funding_info!( monitor) ) ;
791
+ log_trace ! ( logger, "Updating ChannelMonitor to id {} for channel {}" , update . update_id , log_funding_info!( monitor) ) ;
775
792
let update_res = monitor. update_monitor ( update, & self . broadcaster , & self . fee_estimator , & self . logger ) ;
776
793
777
794
let update_id = MonitorUpdateId :: from_monitor_update ( update) ;
0 commit comments