Browse Source
small timeout change
(re KeyError: can happen after proxy settings change)
3.3.3.1
SomberNight
7 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
6 additions and
6 deletions
-
electrum/interface.py
-
electrum/network.py
|
|
@ -213,7 +213,7 @@ class Interface(PrintError): |
|
|
|
return None |
|
|
|
|
|
|
|
async def get_block_header(self, height, assert_mode): |
|
|
|
res = await asyncio.wait_for(self.session.send_request('blockchain.block.header', [height]), 1) |
|
|
|
res = await asyncio.wait_for(self.session.send_request('blockchain.block.header', [height]), 5) |
|
|
|
return blockchain.deserialize_header(bytes.fromhex(res), height) |
|
|
|
|
|
|
|
async def request_chunk(self, idx, tip): |
|
|
|
|
|
@ -32,6 +32,8 @@ import socket |
|
|
|
import json |
|
|
|
import sys |
|
|
|
import ipaddress |
|
|
|
import asyncio |
|
|
|
import concurrent.futures |
|
|
|
|
|
|
|
import dns |
|
|
|
import dns.resolver |
|
|
@ -42,9 +44,6 @@ from .bitcoin import COIN |
|
|
|
from . import constants |
|
|
|
from . import blockchain |
|
|
|
from .interface import Interface |
|
|
|
|
|
|
|
import asyncio |
|
|
|
import concurrent.futures |
|
|
|
from .version import PROTOCOL_VERSION |
|
|
|
|
|
|
|
NODES_RETRY_INTERVAL = 60 |
|
|
@ -700,7 +699,8 @@ class Network(PrintError): |
|
|
|
self.connection_down(interface.server) |
|
|
|
return |
|
|
|
finally: |
|
|
|
self.connecting.remove(server) |
|
|
|
try: self.connecting.remove(server) |
|
|
|
except KeyError: pass |
|
|
|
|
|
|
|
with self.interface_lock: |
|
|
|
self.interfaces[server] = interface |
|
|
@ -757,7 +757,7 @@ class Network(PrintError): |
|
|
|
if tip is not None: |
|
|
|
size = min(size, tip - index * 2016) |
|
|
|
size = max(size, 0) |
|
|
|
res = await session.send_request('blockchain.block.headers', [index * 2016, size]) |
|
|
|
res = await asyncio.wait_for(session.send_request('blockchain.block.headers', [index * 2016, size]), 20) |
|
|
|
conn = self.blockchain().connect_chunk(index, res['hex']) |
|
|
|
if not conn: |
|
|
|
return conn, 0 |
|
|
|