Browse Source

Move some code back to correct place

Fixes #12
master
Neil Booth 8 years ago
parent
commit
1737bb8354
  1. 12
      server/block_processor.py

12
server/block_processor.py

@ -536,6 +536,9 @@ class BlockProcessor(server.db.DB):
self.height - self.db_height)) self.height - self.db_height))
self.utxo_cache.flush(batch) self.utxo_cache.flush(batch)
self.utxo_flush_count = self.flush_count self.utxo_flush_count = self.flush_count
self.db_tx_count = self.tx_count
self.db_height = self.height
self.db_tip = self.tip
def assert_flushed(self): def assert_flushed(self):
'''Asserts state is fully flushed.''' '''Asserts state is fully flushed.'''
@ -573,13 +576,6 @@ class BlockProcessor(server.db.DB):
self.flush_state(batch) self.flush_state(batch)
self.logger.info('committing transaction...') self.logger.info('committing transaction...')
# Update our in-memory state after successful flush
self.db_tx_count = self.tx_count
self.db_height = self.height
self.db_tip = self.tip
self.tx_hashes = []
self.headers = []
# Update and put the wall time again - otherwise we drop the # Update and put the wall time again - otherwise we drop the
# time it took to commit the batch # time it took to commit the batch
self.flush_state(self.db) self.flush_state(self.db)
@ -671,6 +667,8 @@ class BlockProcessor(server.db.DB):
os.sync() os.sync()
self.tx_hashes = []
self.headers = []
self.logger.info('FS flush took {:.1f} seconds' self.logger.info('FS flush took {:.1f} seconds'
.format(time.time() - flush_start)) .format(time.time() - flush_start))

Loading…
Cancel
Save