diff --git a/liana-gui/src/app/state/mod.rs b/liana-gui/src/app/state/mod.rs index 070d9143..8162faad 100644 --- a/liana-gui/src/app/state/mod.rs +++ b/liana-gui/src/app/state/mod.rs @@ -313,8 +313,11 @@ impl State for Home { daemon: Arc, wallet: Arc, ) -> Command { - // Wait for wallet to finish syncing before reloading data. - if !self.sync_status.is_synced() { + // If the wallet is syncing, we expect it to finish soon and so better to wait for + // updated data before reloading. Besides, if the wallet is syncing, the DB may be + // locked if the poller is running and we wouldn't be able to reload data until + // syncing completes anyway. + if self.sync_status.wallet_is_syncing() { return Command::none(); } self.selected_event = None; diff --git a/liana-gui/src/app/wallet.rs b/liana-gui/src/app/wallet.rs index d694cb5d..f9a04896 100644 --- a/liana-gui/src/app/wallet.rs +++ b/liana-gui/src/app/wallet.rs @@ -207,6 +207,11 @@ impl SyncStatus { pub fn is_synced(&self) -> bool { self == &SyncStatus::Synced } + + /// Whether the wallet itself, and not the blockchain, is syncing. + pub fn wallet_is_syncing(&self) -> bool { + self == &SyncStatus::WalletFullScan || self == &SyncStatus::LatestWalletSync + } } /// Get the [`SyncStatus`].