Skip to content

Commit 05bc7e9

Browse files
committed
limit max_connected to 1 for electrum activation (#195)
1 parent 3d25b0c commit 05bc7e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/mm2/mm2_api/rpc/electrum/electrum_req.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:web_dex/common/screen.dart';
12
import 'package:web_dex/model/electrum.dart';
23

34
class ElectrumReq {
@@ -22,6 +23,12 @@ class ElectrumReq {
2223
'method': method,
2324
'coin': coin,
2425
'servers': servers.map((server) => server.toJson()).toList(),
26+
// limit the number of active connections to electrum servers to 1 to
27+
// reduce device load & request spamming. Use 3 connections on desktop
28+
// and 1 on mobile (web and native) using [isMobile] until a better
29+
// alternative is found
30+
// https://komodoplatform.com/en/docs/komodo-defi-framework/api/legacy/coin_activation/#electrum-method
31+
'max_connected': isMobile ? 1 : 3,
2532
'userpass': userpass,
2633
'mm2': mm2,
2734
'tx_history': true,

0 commit comments

Comments
 (0)