From b5ad7b93c8cb00d736f2864d2bce38123dbf8ae7 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 19 Nov 2012 15:40:53 +0400 Subject: [PATCH] do not store undo info during catch up --- backends/bitcoind/blockchain_processor.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index df03cc5..784cd98 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -394,7 +394,8 @@ class BlockchainProcessor(Processor): return eval(s) def write_undo_info(self, batch, height, undo_info): - batch.Put("undo%d"%(height%100), repr(undo_info)) + if self.is_test or height > self.bitcoind_height - 100: + batch.Put("undo%d"%(height%100), repr(undo_info)) def import_block(self, block, block_hash, block_height, sync, revert=False): @@ -663,8 +664,8 @@ class BlockchainProcessor(Processor): # are we done yet? info = self.bitcoind('getinfo') - bitcoind_height = info.get('blocks') - bitcoind_block_hash = self.bitcoind('getblockhash', [bitcoind_height]) + self.bitcoind_height = info.get('blocks') + bitcoind_block_hash = self.bitcoind('getblockhash', [self.bitcoind_height]) if self.last_hash == bitcoind_block_hash: self.up_to_date = True break -- 1.7.1