diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index 8558afe5c..4391736d0 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -605,8 +605,7 @@ class BlockProcessor: # Key: b'h' + compressed_tx_hash + tx_idx + tx_num # Value: hashX prefix = b'h' + tx_hash[:4] + idx_packed - candidates = {db_key: hashX for db_key, hashX - in self.db.utxo_db.iterator(prefix=prefix)} + candidates = dict(self.db.utxo_db.iterator(prefix=prefix)) for hdb_key, hashX in candidates.items(): tx_num_packed = hdb_key[-4:] if len(candidates) > 1: diff --git a/lbry/wallet/server/leveldb.py b/lbry/wallet/server/leveldb.py index 7c023ee2e..5498706bd 100644 --- a/lbry/wallet/server/leveldb.py +++ b/lbry/wallet/server/leveldb.py @@ -137,9 +137,7 @@ class LevelDB: return def get_headers(): - return [ - header for header in self.headers_db.iterator(prefix=HEADER_PREFIX, include_key=False) - ] + return list(self.headers_db.iterator(prefix=HEADER_PREFIX, include_key=False)) headers = await asyncio.get_event_loop().run_in_executor(self.executor, get_headers) assert len(headers) - 1 == self.db_height, f"{len(headers)} vs {self.db_height}" diff --git a/lbry/wallet/server/mempool.py b/lbry/wallet/server/mempool.py index ce08f7446..276fcf66c 100644 --- a/lbry/wallet/server/mempool.py +++ b/lbry/wallet/server/mempool.py @@ -324,7 +324,7 @@ class MemPool: for prevout in tx.prevouts if prevout[0] not in all_hashes) utxos = await self.api.lookup_utxos(prevouts) - utxo_map = {prevout: utxo for prevout, utxo in zip(prevouts, utxos)} + utxo_map = dict(zip(prevouts, utxos)) return self._accept_transactions(tx_map, utxo_map, touched)