From 43ca91258b23a50a7670e2bc474ec8d65eab343a Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Fri, 14 Jan 2022 18:06:48 +0530 Subject: [PATCH] 1.0.6 Bootstrap-rebuild from latestCache db --- test_rebuild.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test_rebuild.py b/test_rebuild.py index 388a6d9..2420b36 100644 --- a/test_rebuild.py +++ b/test_rebuild.py @@ -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') \ No newline at end of file + 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()