@@ -296,6 +296,8 @@ pub struct ChainMonitor<ChannelSigner: WriteableEcdsaChannelSigner, C: Deref, T:
296
296
/// The best block height seen, used as a proxy for the passage of time.
297
297
highest_chain_height : AtomicUsize ,
298
298
299
+ /// A [`Notifier`] used to wake up the background processor in case we have any [`Event`]s for
300
+ /// it to give to users (or [`MonitorEvent`]s for `ChannelManager` to process).
299
301
event_notifier : Notifier ,
300
302
}
301
303
@@ -738,6 +740,8 @@ where
738
740
monitor. block_connected (
739
741
header, txdata, height, & * self . broadcaster , & * self . fee_estimator , & self . logger )
740
742
} ) ;
743
+ // Assume we may have some new events and wake the event processor
744
+ self . event_notifier . notify ( ) ;
741
745
}
742
746
743
747
fn block_disconnected ( & self , header : & Header , height : u32 ) {
@@ -765,6 +769,8 @@ where
765
769
monitor. transactions_confirmed (
766
770
header, txdata, height, & * self . broadcaster , & * self . fee_estimator , & self . logger )
767
771
} ) ;
772
+ // Assume we may have some new events and wake the event processor
773
+ self . event_notifier . notify ( ) ;
768
774
}
769
775
770
776
fn transaction_unconfirmed ( & self , txid : & Txid ) {
@@ -785,6 +791,8 @@ where
785
791
header, height, & * self . broadcaster , & * self . fee_estimator , & self . logger
786
792
)
787
793
} ) ;
794
+ // Assume we may have some new events and wake the event processor
795
+ self . event_notifier . notify ( ) ;
788
796
}
789
797
790
798
fn get_relevant_txids ( & self ) -> Vec < ( Txid , u32 , Option < BlockHash > ) > {
0 commit comments