diff --git a/silkaj/blocks.py b/silkaj/blocks.py index c59107c08999dddc4cad6e633b871e12e6681a38..4f0bbdddf1cbc17adeb56073510c1dec8704c041 100644 --- a/silkaj/blocks.py +++ b/silkaj/blocks.py @@ -17,7 +17,6 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>. import logging -from aiohttp.client_exceptions import ServerDisconnectedError from click import INT, argument, command, progressbar from duniterpy.api import bma from duniterpy.api.client import Client @@ -89,9 +88,6 @@ def get_chunk_size(from_block, to_block, chunks_from, chunk_from): def get_chunk(client, chunk_size, chunk_from): try: return client(bma.blockchain.blocks, chunk_size, chunk_from) - except ServerDisconnectedError: - logging.info("Reach BMA anti-spam protection. Waiting two seconds") - return client(bma.blockchain.blocks, chunk_size, chunk_from) except DuniterError as error: logging.error(error) diff --git a/silkaj/commands.py b/silkaj/commands.py index a6358362c5241adb4f97d59241ddb940334f1486..9739f94411c919031ddf3337746dc92e328bd7d3 100644 --- a/silkaj/commands.py +++ b/silkaj/commands.py @@ -20,9 +20,7 @@ from collections import OrderedDict from operator import itemgetter from os import system -import aiohttp import jsonschema -from _socket import gaierror from click import IntRange, argument, command, option from duniterpy.api import bma from pendulum import from_timestamp @@ -31,13 +29,8 @@ from tabulate import tabulate from silkaj.blockchain_tools import HeadBlock from silkaj.constants import ALL, HOUR from silkaj.network_tools import ClientInstance, EndPoint, best_endpoint_address -from silkaj.wot_tools import identity_of -from silkaj.network_tools import ( - best_endpoint_address, - EndPoint, - ClientInstance, -) from silkaj.tools import CurrencySymbol +from silkaj.wot_tools import identity_of @command("info", help="Display information about currency") @@ -103,11 +96,6 @@ def difficulties(): diffi = client(bma.blockchain.difficulties) display_diffi(current, diffi) client.close() - - except (aiohttp.WSServerHandshakeError, ValueError) as e: - print("Websocket block {0} : {1}".format(type(e).__name__, str(e))) - except (aiohttp.ClientError, gaierror, TimeoutError) as e: - print("{0} : {1}".format(str(e), BMAS_ENDPOINT)) except jsonschema.ValidationError as e: print("{:}:{:}".format(str(e.__class__.__name__), str(e)))