From fc85f9022b271f71e1230c50df9a5aa1275429c4 Mon Sep 17 00:00:00 2001 From: 4tochka Date: Sat, 4 May 2019 13:48:01 +0400 Subject: [PATCH] connector --- pybtc/connector.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pybtc/connector.py b/pybtc/connector.py index ff55506..71ef74a 100644 --- a/pybtc/connector.py +++ b/pybtc/connector.py @@ -432,6 +432,10 @@ class Connector: except Exception as err: if self.await_tx: self.await_tx = set() + for i in self.await_tx_future: + if not self.await_tx_future.done(): + self.await_tx_future[i].cancel() + self.await_tx_future = dict() self.log.error(str(traceback.format_exc())) self.log.error("block error %s" % str(err)) finally: @@ -457,7 +461,7 @@ class Connector: block["time"], block["height"], i)) - await asyncio.wait_for(self.block_txs_request) + await asyncio.wait_for(self.block_txs_request, timeout=1500) elif tx_bin_list: