increase timeout durations for proxied calls

and pass bools accordingly
This commit is contained in:
sneurlax 2024-06-22 18:40:30 -05:00
parent ced64b12d6
commit 535d7bf85e

View file

@ -47,16 +47,18 @@ Future<bool> checkElectrumServer({
final client = await ElectrumClient.connect(
host: host,
port: port,
useSSL: useSSL,
useSSL: useSSL && !host.endsWith('.onion'),
proxyInfo: proxyInfo,
).timeout(
const Duration(seconds: 5),
Duration(seconds: (proxyInfo == null ? 5 : 30)),
onTimeout: () => throw Exception(
"The checkElectrumServer connect() call timed out.",
),
);
await client.ping().timeout(const Duration(seconds: 5));
await client
.ping()
.timeout(Duration(seconds: (proxyInfo == null ? 5 : 30)));
return true;
} catch (_) {