Merge pull request #3369 from lbryio/fix-hanging-tx-notification

fix stuck transaction notification due to race in mempool when advancing a block
This commit is contained in:
Jack Robison 2021-07-20 18:54:22 -04:00 committed by GitHub
commit f257ff2f97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -750,7 +750,7 @@ class Ledger(metaclass=LedgerRegistry):
))[1] if record['history'] else [] ))[1] if record['history'] else []
for txid, local_height in local_history: for txid, local_height in local_history:
if txid == tx.id: if txid == tx.id:
if local_height >= height: if local_height >= height or (local_height == 0 and height > local_height):
return True return True
log.warning( log.warning(
"local history has higher height than remote for %s (%i vs %i)", txid, "local history has higher height than remote for %s (%i vs %i)", txid,

View file

@ -470,7 +470,7 @@ class TestUpgrade(AsyncioTestCase):
class TestSQLiteRace(AsyncioTestCase): class TestSQLiteRace(AsyncioTestCase):
max_misuse_attempts = 40000 max_misuse_attempts = 80000
def setup_db(self): def setup_db(self):
self.db = sqlite3.connect(":memory:", isolation_level=None) self.db = sqlite3.connect(":memory:", isolation_level=None)