log mempool task exceptions

This commit is contained in:
Victor Shyba 2021-03-02 19:59:15 -03:00
parent 02eb789f84
commit 319187d6d6

View file

@ -210,6 +210,15 @@ class MemPool:
return deferred, {prevout: utxo_map[prevout] for prevout in unspent} return deferred, {prevout: utxo_map[prevout] for prevout in unspent}
async def _mempool_loop(self, synchronized_event):
try:
return await self._refresh_hashes(synchronized_event)
except asyncio.CancelledError:
raise
except Exception as e:
self.logger.exception("MEMPOOL DIED")
raise e
async def _refresh_hashes(self, synchronized_event): async def _refresh_hashes(self, synchronized_event):
"""Refresh our view of the daemon's mempool.""" """Refresh our view of the daemon's mempool."""
while True: while True:
@ -326,7 +335,7 @@ class MemPool:
async def keep_synchronized(self, synchronized_event): async def keep_synchronized(self, synchronized_event):
"""Keep the mempool synchronized with the daemon.""" """Keep the mempool synchronized with the daemon."""
await asyncio.wait([ await asyncio.wait([
self._refresh_hashes(synchronized_event), self._mempool_loop(synchronized_event),
# self._refresh_histogram(synchronized_event), # self._refresh_histogram(synchronized_event),
self._logging(synchronized_event) self._logging(synchronized_event)
]) ])