From 5541b80179f0892b1b17502b042c3e1f8178baf9 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 6 Jun 2021 13:06:30 -0400 Subject: [PATCH] fix flush id --- lbry/wallet/server/leveldb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbry/wallet/server/leveldb.py b/lbry/wallet/server/leveldb.py index b844e78dc..fc79c19f6 100644 --- a/lbry/wallet/server/leveldb.py +++ b/lbry/wallet/server/leveldb.py @@ -540,7 +540,7 @@ class LevelDB: keys = [] for key, hist in self.db.iterator(prefix=DB_PREFIXES.HASHX_HISTORY_PREFIX.value): k = key[1:] - flush_id, = unpack_be_uint16_from(k[-2:]) + flush_id = int.from_bytes(k[-4:], byteorder='big') if flush_id > self.utxo_flush_count: keys.append(k) @@ -719,7 +719,7 @@ class LevelDB: # Then history self.hist_flush_count += 1 - flush_id = pack_be_uint16(self.hist_flush_count) + flush_id = util.pack_be_uint32(self.hist_flush_count) unflushed = self.hist_unflushed for hashX in sorted(unflushed):