mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 17:27:39 +00:00
increase timeout durations for proxied calls
and pass bools accordingly
This commit is contained in:
parent
ced64b12d6
commit
535d7bf85e
1 changed files with 5 additions and 3 deletions
|
@ -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 (_) {
|
||||
|
|
Loading…
Reference in a new issue