Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864391
D14213.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D14213.diff
View Options
diff --git a/electrum/electrumabc/network.py b/electrum/electrumabc/network.py
--- a/electrum/electrumabc/network.py
+++ b/electrum/electrumabc/network.py
@@ -58,6 +58,15 @@
# start on the wrong chain.
DEFAULT_WHITELIST_SERVERS_ONLY = True
+# Rate-limit the get_merkle requests sent to fulcrum servers.
+# This affects the speed of the initial verification of transactions in a wallet with
+# a large transaction history. Values up to 10000 have been successfully tested for a
+# single client, and the fulcrum developer thinks it is safe to raise it from its
+# previous value (10).
+# If no issues are encountered after this change has been released, it should be safe
+# to increase it more (to 500 or 1000) in future releases.
+MAX_QLEN_GET_MERKLE_REQUESTS = 100
+
def parse_servers(result):
"""parse servers list into dict format"""
@@ -2318,7 +2327,7 @@
return _("An error occurred broadcasting the transaction")
# Used by the verifier job.
- def get_merkle_for_transaction(self, tx_hash, tx_height, callback, max_qlen=10):
+ def get_merkle_for_transaction(self, tx_hash, tx_height, callback):
"""Asynchronously enqueue a request for a merkle proof for a tx.
Note that the callback param is required.
May return None if too many requests were enqueued (max_qlen) or
@@ -2328,7 +2337,7 @@
"blockchain.transaction.get_merkle",
[tx_hash, tx_height],
callback=callback,
- max_qlen=max_qlen,
+ max_qlen=MAX_QLEN_GET_MERKLE_REQUESTS,
)
def get_proxies(self):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 19:20 (3 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5865773
Default Alt Text
D14213.diff (1 KB)
Attached To
D14213: [electrum] increase the max number of get_merkle requests in the network queue
Event Timeline
Log In to Comment