From 8cb3fe8831d33324fd32fd82a3ba4da737518eab Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 5 May 2021 15:53:17 -0400 Subject: [PATCH] dead code --- lbry/wallet/server/block_processor.py | 11 +---------- lbry/wallet/server/leveldb.py | 6 ++---- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index 672a04d49..6ef0c50b7 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -362,15 +362,6 @@ class BlockProcessor: return start, count - def estimate_txs_remaining(self): - # Try to estimate how many txs there are to go - daemon_height = self.daemon.cached_height() - coin = self.coin - tail_count = daemon_height - max(self.height, coin.TX_COUNT_HEIGHT) - # Damp the initial enthusiasm - realism = max(2.0 - 0.9 * self.height / coin.TX_COUNT_HEIGHT, 1.0) - return (tail_count * coin.TX_PER_BLOCK + - max(coin.TX_COUNT - self.tx_count, 0)) * realism # - Flushing def flush_data(self): @@ -382,7 +373,7 @@ class BlockProcessor: async def flush(self, flush_utxos): def flush(): - self.db.flush_dbs(self.flush_data(), self.estimate_txs_remaining) + self.db.flush_dbs(self.flush_data()) await self.run_in_thread_with_lock(flush) async def _maybe_flush(self): diff --git a/lbry/wallet/server/leveldb.py b/lbry/wallet/server/leveldb.py index 0c0cb5c6e..533f7a780 100644 --- a/lbry/wallet/server/leveldb.py +++ b/lbry/wallet/server/leveldb.py @@ -623,7 +623,7 @@ class LevelDB: assert not flush_data.undo_infos assert not self.hist_unflushed - def flush_dbs(self, flush_data: FlushData, estimate_txs_remaining): + def flush_dbs(self, flush_data: FlushData): """Flush out cached state. History is always flushed; UTXOs are flushed if flush_utxos.""" @@ -760,11 +760,9 @@ class LevelDB: flush_interval = self.last_flush - prior_flush tx_per_sec_gen = int(flush_data.tx_count / self.wall_time) tx_per_sec_last = 1 + int(tx_delta / flush_interval) - eta = estimate_txs_remaining() / tx_per_sec_last self.logger.info(f'tx/sec since genesis: {tx_per_sec_gen:,d}, ' f'since last flush: {tx_per_sec_last:,d}') - self.logger.info(f'sync time: {formatted_time(self.wall_time)} ' - f'ETA: {formatted_time(eta)}') + self.logger.info(f'sync time: {formatted_time(self.wall_time)}') def flush_backup(self, flush_data, touched): """Like flush_dbs() but when backing up. All UTXOs are flushed."""