X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Fbitcoind%2Fblockchain_processor.py;h=784cd9800a55c1900c7db744bb7be711ec3d7a00;hp=df03cc5d2e6fbf07d81090cc50352a0d670c03e2;hb=b5ad7b93c8cb00d736f2864d2bce38123dbf8ae7;hpb=0f5b4987279dbecb208a1a7040fc9a1b671e61d8 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