From b086763e223225b1ecc7ec400f897f4fb67c7bb9 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Thu, 30 Jul 2015 21:57:43 +0300 Subject: [PATCH] Fix reorg issues --- backends/bitcoind/blockchain_processor.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index 1b8d92f..1c3a341 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -627,10 +627,11 @@ class BlockchainProcessor(Processor): self.up_to_date = False try: next_block = self.bitcoind('getblockbynumber', [self.storage.height + 1, True]) - next_block_hash = next_block.get('hash') except BaseException, e: + next_block = self.bitcoind('getblock', [self.storage.last_hash, True]) revert = True - next_block = next_block.get(self.storage.last_hash) + + next_block_hash = next_block.get('hash') self.mtime('daemon') -- 1.7.1