diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 35c890e6b..c6291c399 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -131,7 +131,7 @@ class Ledger(metaclass=LedgerRegistry): self._on_transaction_controller = StreamController() self.on_transaction = self._on_transaction_controller.stream self.on_transaction.listen( - lambda e: log.info( + lambda e: log.debug( '(%s) on_transaction: address=%s, height=%s, is_verified=%s, tx.id=%s', self.get_id(), e.address, e.tx.height, e.tx.is_verified, e.tx.id ) diff --git a/lbry/wallet/server/leveldb.py b/lbry/wallet/server/leveldb.py index 3adf8ed44..0e78d6d14 100644 --- a/lbry/wallet/server/leveldb.py +++ b/lbry/wallet/server/leveldb.py @@ -74,9 +74,11 @@ class RocksReaderContext: def update_state(self): tx_counts = array.array("L") counts = self.db.get(TX_COUNTS_STATE) - if counts: + if not counts: + self.tx_counts = list(map(unpack_be_uint64, self.db.iterator(prefix=TX_COUNT_PREFIX, include_key=False))) + else: tx_counts.frombytes(counts) - self.tx_counts = tx_counts.tolist() + self.tx_counts = tx_counts.tolist() def ctx_tx_hash(self, tx_num): tx_height = bisect_right(self.tx_counts, tx_num)