From 9a8f9f0a94bf5dd9b49a0f1eca16b4ad73b5f0c8 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 20 Jul 2021 15:14:10 -0400 Subject: [PATCH 1/2] fix stuck notification due to mempool/notification race --- lbry/wallet/ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 73d065914..dd8c6812b 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -750,7 +750,7 @@ class Ledger(metaclass=LedgerRegistry): ))[1] if record['history'] else [] for txid, local_height in local_history: if txid == tx.id: - if local_height >= height: + if local_height >= height or (local_height == 0 and height > local_height): return True log.warning( "local history has higher height than remote for %s (%i vs %i)", txid, From 7ad5822c5bf84a580599e5f2e5267e032ea46932 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 20 Jul 2021 16:03:34 -0400 Subject: [PATCH 2/2] fix test --- tests/unit/wallet/test_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/wallet/test_database.py b/tests/unit/wallet/test_database.py index b796a9c1a..8c0b4e9f8 100644 --- a/tests/unit/wallet/test_database.py +++ b/tests/unit/wallet/test_database.py @@ -470,7 +470,7 @@ class TestUpgrade(AsyncioTestCase): class TestSQLiteRace(AsyncioTestCase): - max_misuse_attempts = 40000 + max_misuse_attempts = 80000 def setup_db(self): self.db = sqlite3.connect(":memory:", isolation_level=None)