File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,7 +321,11 @@ class LightningRepo @Inject constructor(
321321 do {
322322 syncPending.set(false )
323323 _lightningState .update { it.copy(isSyncingWallet = true ) }
324- lightningService.sync()
324+ runCatching {
325+ lightningService.sync()
326+ }.onFailure {
327+ return @executeWhenNodeRunning Result .failure(it)
328+ }
325329 refreshChannelCache()
326330 syncState()
327331 if (syncPending.get()) delay(MS_SYNC_LOOP_DEBOUNCE )
Original file line number Diff line number Diff line change @@ -276,7 +276,15 @@ class WalletViewModel @Inject constructor(
276276 walletRepo.syncNodeAndWallet()
277277 .onFailure {
278278 Logger .error(" Failed to refresh state: ${it.message} " , it)
279- if (it is CancellationException || it.isTxSyncTimeout()) return @onFailure
279+ if (it is CancellationException ) return @onFailure
280+ if (it.isTxSyncTimeout()) {
281+ ToastEventBus .send(
282+ type = Toast .ToastType .ERROR ,
283+ title = context.getString(R .string.wallet__ldk_sync_error_title),
284+ description = context.getString(R .string.wallet__ldk_sync_error_body),
285+ )
286+ return @onFailure
287+ }
280288 ToastEventBus .send(it)
281289 }
282290 }
Original file line number Diff line number Diff line change 10991099 <string name =" wallet__filter_title" >Select Range</string >
11001100 <string name =" wallet__instant_payment_received" >Received Instant Bitcoin</string >
11011101 <string name =" wallet__ldk_start_error_title" >Lightning Startup Error</string >
1102+ <string name =" wallet__ldk_sync_error_body" >Unable to sync with the network. Please try again later.</string >
11021103 <string name =" wallet__ldk_sync_error_title" >Lightning Sync Error</string >
11031104 <string name =" wallet__lnurl_p_max" >Maximum amount</string >
11041105 <string name =" wallet__lnurl_p_title" >Pay Bitcoin</string >
You can’t perform that action at this time.
0 commit comments