From a4a11fca8d0b078c429d9ff369de1bd1fed334a3 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 4 Dec 2013 13:05:21 +0400 Subject: [PATCH] fix locks --- backends/bitcoind/blockchain_processor.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index d4c56f4..875273f 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -686,14 +686,14 @@ class BlockchainProcessor(Processor): error = None if method == 'blockchain.numblocks.subscribe': - if session not in self.watch_headers: - with self.watch_lock: + with self.watch_lock: + if session not in self.watch_blocks: self.watch_blocks.append(session) result = self.height elif method == 'blockchain.headers.subscribe': - if session not in self.watch_headers: - with self.watch_lock: + with self.watch_lock: + if session not in self.watch_headers: self.watch_headers.append(session) result = self.header -- 1.7.1