diff --git a/src/wallet/wallet.rs b/src/wallet/wallet.rs index 9b6a4aa..db4bcf8 100644 --- a/src/wallet/wallet.rs +++ b/src/wallet/wallet.rs @@ -1857,6 +1857,19 @@ fn start_sync(wallet: Wallet) -> Thread { return; } + // Start the nostr payment-messaging service the moment the wallet is + // open — BEFORE (and independent of) the grin node sync. Previously + // this lived deep in the sync body behind `!sync_error` and the node + // checks, so the Nym/relay connection could wait up to a full + // SYNC_DELAY (60s) — or never start while the node errored — leaving + // the profile stuck on "Connecting…". Idempotent. + if let Some(service) = wallet.nostr_service() { + service.start(wallet.clone()); + // Auto-cancel/expire stale pending transactions (frees outputs + // locked by stale sends). + service.expire_stale(&wallet); + } + // Check integrated node state. if wallet.get_current_connection() == ConnectionMethod::Integrated { let not_enabled = !Node::is_running() || Node::is_stopping(); @@ -1900,14 +1913,6 @@ fn start_sync(wallet: Wallet) -> Thread { Err(_) => {} } } - - // Start nostr payment-messaging service (idempotent). - if let Some(service) = wallet.nostr_service() { - service.start(wallet.clone()); - // Auto-cancel/expire transactions left pending past the - // configured window (frees outputs locked by stale sends). - service.expire_stale(&wallet); - } } // Sync wallet from node.