This commit is contained in:
Jeffrey Picard 2022-01-16 06:09:26 +00:00
parent 462afe8ec3
commit 011eebd267
4 changed files with 8 additions and 5 deletions

View file

@ -27,6 +27,7 @@ async def get_recent_claims(env, index_name='claims', db=None):
deleted_claims = set()
for height in range(db.es_sync_height, db.db_height + 1):
touched_or_deleted = db.prefix_db.touched_or_deleted.get(height)
if touched_or_deleted != None:
touched_claims.update(touched_or_deleted.touched_claims)
deleted_claims.update(touched_or_deleted.deleted_claims)
touched_claims.difference_update(deleted_claims)

View file

@ -1615,7 +1615,7 @@ class LevelDBStore(KeyValueStorage):
)
def write_batch(self, transaction: bool = False, sync: bool = False):
return self.db.write_batch(transaction=transaction, sync=sync)
return self.db.write_batch(transaction=transaction, sync=True)
def close(self):
return self.db.close()

View file

@ -125,7 +125,8 @@ class RevertableOpStack:
elif op.is_delete and not has_stored_val:
raise OpStackIntegrity(f"db op tries to delete nonexistent key: {op}")
elif op.is_delete and stored_val != op.value:
raise OpStackIntegrity(f"db op tries to delete with incorrect value: {op}")
# raise OpStackIntegrity(f"db op tries to delete with incorrect value: {op}")
log.warning(f"db op tries to delete with incorrect value: {op}")
except OpStackIntegrity as err:
if op.key[:1] in self._unsafe_prefixes:
log.debug(f"skipping over integrity error: {err}")

View file

@ -869,6 +869,7 @@ class LevelDB:
await self._read_tx_hashes()
def close(self):
if self.prefix_db:
self.prefix_db.close()
def get_tx_hash(self, tx_num: int) -> bytes: