From 026a171c66768eb1fc211f6c47d60d80a46f3394 Mon Sep 17 00:00:00 2001 From: cyan Date: Mon, 17 Aug 2026 14:09:09 +0200 Subject: [PATCH] fix: allow spending with LAN-only node (#3529) --- lib/reactions/check_connection.dart | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/reactions/check_connection.dart b/lib/reactions/check_connection.dart index 8cee07276..1103d0c25 100644 --- a/lib/reactions/check_connection.dart +++ b/lib/reactions/check_connection.dart @@ -28,20 +28,24 @@ void startCheckConnectionReaction(WalletBase wallet, SettingsStore settingsStore try { final connectivityResult = await (Connectivity().checkConnectivity()); + int? chainId; + if (isEVMCompatibleChain(wallet.type)) { + chainId = evm!.getSelectedChainId(wallet); + } + + final node = settingsStore.getCurrentNode(wallet.type, chainId: chainId); + if (connectivityResult.contains(ConnectivityResult.none)) { - wallet.syncStatus = FailedSyncStatus(); - return; + // Still try node even when OS says no network - it might be a LAN node. + if (!await node.requestNode()) { + wallet.syncStatus = FailedSyncStatus(); + return; + } } if (wallet.type != WalletType.bitcoin && (wallet.syncStatus is LostConnectionSyncStatus || wallet.syncStatus is FailedSyncStatus)) { - int? chainId; - if (isEVMCompatibleChain(wallet.type)) { - chainId = evm!.getSelectedChainId(wallet); - } - - final node = settingsStore.getCurrentNode(wallet.type, chainId: chainId); final alive = await node.requestNode(); if (alive) {