X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Fbitcoind%2Fblockchain_processor.py;h=fb7b9576974a89ba104aeb1b06d29e9476986ee0;hp=875273f414c21c58bc04303a4c50b3bcb164eeff;hb=4df3953a9bb15d1a81078e0dbe49b823aa9d4917;hpb=a4a11fca8d0b078c429d9ff369de1bd1fed334a3 diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index 875273f..fb7b957 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -925,9 +925,12 @@ class BlockchainProcessor(Processor): print_log("cache: invalidating", address) self.history_cache.pop(address) - if address in self.watched_addresses: + with self.watch_lock: + sessions = self.watched_addresses.get(address) + + if sessions: # TODO: update cache here. if new value equals cached value, do not send notification - self.address_queue.put(address) + self.address_queue.put((address,sessions)) def main_iteration(self): if self.shared.stopped(): @@ -962,12 +965,12 @@ class BlockchainProcessor(Processor): while True: try: - addr = self.address_queue.get(False) + addr, sessions = self.address_queue.get(False) except: break status = self.get_status(addr) - for session in self.watched_addresses[addr]: + for session in sessions: self.push_response(session, { 'id': None, 'method': 'blockchain.address.subscribe',