diff --git a/lbry/blockchain/sync/blocks.py b/lbry/blockchain/sync/blocks.py index 9777d6214..0bd4b2add 100644 --- a/lbry/blockchain/sync/blocks.py +++ b/lbry/blockchain/sync/blocks.py @@ -309,7 +309,7 @@ def delete_all_the_things(height: int, p: ProgressContext): def constrain(col): if height == -1: return col == -1 - return col <= height + return col >= height deletes = [ BlockTable.delete().where(constrain(BlockTable.c.height)), diff --git a/lbry/service/light_client.py b/lbry/service/light_client.py index 7d64b4a46..cb027b02b 100644 --- a/lbry/service/light_client.py +++ b/lbry/service/light_client.py @@ -1,7 +1,6 @@ import logging from typing import List, Dict, Tuple -from lbry.conf import Config from lbry.blockchain import Ledger, Transaction from lbry.wallet.sync import SPVSync diff --git a/lbry/testcase.py b/lbry/testcase.py index 5a2c62cd0..d3e64493a 100644 --- a/lbry/testcase.py +++ b/lbry/testcase.py @@ -14,9 +14,9 @@ import unittest from unittest.case import _Outcome from typing import Optional, List, Union from binascii import unhexlify, hexlify +from distutils.dir_util import remove_tree import ecdsa -from distutils.dir_util import remove_tree from lbry.db import Database from lbry.blockchain import ( @@ -430,7 +430,7 @@ class IntegrationTestCase(AsyncioTestCase): db = Database.temp_sqlite_regtest(chain.ledger.conf) elif db_driver.startswith('postgres') or db_driver.startswith('psycopg'): db_driver = 'postgresql' - db_name = f'lbry_test_chain' + db_name = 'lbry_test_chain' db_connection = 'postgres:postgres@localhost:5432' meta_db = Database.from_url(f'postgresql://{db_connection}/postgres') await meta_db.drop(db_name)