1.0.6 Bootstrap-rebuild from latestCache db

This commit is contained in:
Vivek Teega 2022-01-14 18:06:48 +05:30
parent 6ce6f75a0e
commit 43ca91258b

View File

@ -176,7 +176,6 @@ old_latest_cache.execute("ATTACH DATABASE 'latestCache.db' AS new_db")
old_latest_cache.execute("INSERT INTO new_db.latestBlocks SELECT * FROM latestBlocks")
old_latest_cache.close()
# delete
# system.db , latestCache.db, smartContracts, tokens
if os.path.isfile('./system1.db'):
@ -186,4 +185,9 @@ if os.path.isfile('./latestCache1.db'):
if os.path.isfile('./smartContracts1'):
shutil.rmtree('smartContracts1')
if os.path.isfile('./tokens1'):
shutil.rmtree('tokens1')
shutil.rmtree('tokens1')
# Update system.db's last scanned block
connection = create_database_connection('system_dbs', {'db_name': "system"})
connection.execute(f"UPDATE systemData SET value = {int(list(lblocks_dict.keys())[-1])} WHERE attribute = 'lastblockscanned';")
connection.close()