From 50ecb0dac9366b0e3a846ea0f591e184613c9d1b Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 16 Jun 2020 17:58:37 -0400 Subject: [PATCH] fix notify --- lbry/wallet/server/session.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lbry/wallet/server/session.py b/lbry/wallet/server/session.py index 810b11dba..6a831ec1a 100644 --- a/lbry/wallet/server/session.py +++ b/lbry/wallet/server/session.py @@ -940,13 +940,21 @@ class LBRYElectrumX(SessionBase): touched = touched.intersection(self.hashX_subs) if touched or (height_changed and self.mempool_statuses): + notified = set() + mempool_addrs = tuple(self.mempool_statuses.keys()) for hashX in touched: alias = self.hashX_subs[hashX] asyncio.create_task(send_history_notification(alias, hashX)) + notified.add(hashX) + for hashX in mempool_addrs: + if hashX not in notified: + alias = self.hashX_subs[hashX] + asyncio.create_task(send_history_notification(alias, hashX)) + notified.add(hashX) if touched: es = '' if len(touched) == 1 else 'es' - self.logger.info(f'notified of {len(touched):,d} address{es}') + self.logger.info(f'notified {len(notified)} mempool/{len(touched):,d} touched address{es}') def get_metrics_or_placeholder_for_api(self, query_name): """ Do not hold on to a reference to the metrics @@ -1175,7 +1183,6 @@ class LBRYElectrumX(SessionBase): self.mempool_statuses[hashX] = status else: self.mempool_statuses.pop(hashX, None) - return status async def hashX_listunspent(self, hashX):