File tree Expand file tree Collapse file tree
lightning-transaction-sync/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,13 @@ impl<L: Logger> ElectrumSyncClient<L> {
9696 let mut tip_header = tip_notification. header ;
9797 let mut tip_height = tip_notification. height as u32 ;
9898
99- loop {
99+ for i in 0 ..100 {
100+ if i >= 10 {
101+ log_debug ! ( self . logger, "Giving up trying to sync transactions after 10 attempts." ) ;
102+ sync_state. pending_sync = true ;
103+ return Err ( TxSyncError :: Failed ) ;
104+ }
105+
100106 let pending_registrations = self . queue . lock ( ) . unwrap ( ) . process_queues ( & mut sync_state) ;
101107 let tip_is_new = Some ( tip_header. block_hash ( ) ) != sync_state. last_sync_hash ;
102108
Original file line number Diff line number Diff line change @@ -100,7 +100,13 @@ impl<L: Logger> EsploraSyncClient<L> {
100100
101101 let mut tip_hash = maybe_await ! ( self . client. get_tip_hash( ) ) ?;
102102
103- loop {
103+ for i in 0 ..100 {
104+ if i >= 10 {
105+ log_debug ! ( self . logger, "Giving up trying to sync transactions after 10 attempts." ) ;
106+ sync_state. pending_sync = true ;
107+ return Err ( TxSyncError :: Failed ) ;
108+ }
109+
104110 let pending_registrations = self . queue . lock ( ) . unwrap ( ) . process_queues ( & mut sync_state) ;
105111 let tip_is_new = Some ( tip_hash) != sync_state. last_sync_hash ;
106112
You can’t perform that action at this time.
0 commit comments