SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
3 changed files with
8 additions and
7 deletions
-
electrum/address_synchronizer.py
-
electrum/interface.py
-
electrum/util.py
|
|
@ -28,7 +28,7 @@ from collections import defaultdict |
|
|
|
|
|
|
|
from . import bitcoin |
|
|
|
from .bitcoin import COINBASE_MATURITY, TYPE_ADDRESS, TYPE_PUBKEY |
|
|
|
from .util import PrintError, profiler, bfh, VerifiedTxInfo, TxMinedStatus, aiosafe, CustomTaskGroup |
|
|
|
from .util import PrintError, profiler, bfh, VerifiedTxInfo, TxMinedStatus, aiosafe, SilentTaskGroup |
|
|
|
from .transaction import Transaction, TxOutput |
|
|
|
from .synchronizer import Synchronizer |
|
|
|
from .verifier import SPV |
|
|
@ -157,7 +157,7 @@ class AddressSynchronizer(PrintError): |
|
|
|
self.verifier = SPV(self.network, self) |
|
|
|
self.synchronizer = synchronizer = Synchronizer(self) |
|
|
|
assert self.group is None, 'group already exists' |
|
|
|
self.group = CustomTaskGroup() |
|
|
|
self.group = SilentTaskGroup() |
|
|
|
|
|
|
|
async def job(): |
|
|
|
async with self.group as group: |
|
|
|
|
|
@ -34,7 +34,7 @@ from collections import defaultdict |
|
|
|
import aiorpcx |
|
|
|
from aiorpcx import ClientSession, Notification |
|
|
|
|
|
|
|
from .util import PrintError, aiosafe, bfh, AIOSafeSilentException, CustomTaskGroup |
|
|
|
from .util import PrintError, aiosafe, bfh, AIOSafeSilentException, SilentTaskGroup |
|
|
|
from . import util |
|
|
|
from . import x509 |
|
|
|
from . import pem |
|
|
@ -139,7 +139,7 @@ class Interface(PrintError): |
|
|
|
|
|
|
|
# TODO combine? |
|
|
|
self.fut = asyncio.get_event_loop().create_task(self.run()) |
|
|
|
self.group = CustomTaskGroup() |
|
|
|
self.group = SilentTaskGroup() |
|
|
|
|
|
|
|
if proxy: |
|
|
|
username, pw = proxy.get('user'), proxy.get('password') |
|
|
|
|
|
@ -868,10 +868,11 @@ def make_aiohttp_session(proxy): |
|
|
|
return aiohttp.ClientSession(headers={'User-Agent' : 'Electrum'}, timeout=aiohttp.ClientTimeout(total=10)) |
|
|
|
|
|
|
|
|
|
|
|
class CustomTaskGroup(TaskGroup): |
|
|
|
class SilentTaskGroup(TaskGroup): |
|
|
|
|
|
|
|
def spawn(self, *args, **kwargs): |
|
|
|
def spawn(self, *args, report_crash=None, **kwargs): |
|
|
|
# don't complain if group is already closed. |
|
|
|
if self._closed: |
|
|
|
raise asyncio.CancelledError() |
|
|
|
return super().spawn(*args, **kwargs) |
|
|
|
# ignore value of report_crash, and force it to False |
|
|
|
return super().spawn(*args, **kwargs, report_crash=False) |
|
|
|