Skip to content
Snippets Groups Projects
Commit c32a1c4f authored by Marcin's avatar Marcin
Browse files

issue #91: incorrect results when initial sync started not from scratch

The problem was with column hive_stat.block_num which is used only as
a last synced block number, but it was set with a last block number
known by hived
parent 294e2411
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,6 @@ from hive.utils.stats import PrometheusClient as PC
from hive.utils.stats import BroadcastObject
from hive.utils.communities_rank import update_communities_posts_and_rank
from hive.indexer.mock_block_provider import MockBlockProvider
from hive.indexer.mock_vops_provider import MockVopsProvider
from datetime import datetime
log = logging.getLogger(__name__)
......@@ -221,16 +218,6 @@ class Sync:
from hive.db.schema import DB_VERSION as SCHEMA_DB_VERSION
log.info("database_schema_version : %s", SCHEMA_DB_VERSION)
mock_block_data_path = self._conf.get("mock_block_data_path")
if mock_block_data_path:
MockBlockProvider.load_block_data(mock_block_data_path)
MockBlockProvider.print_data()
mock_vops_data_path = self._conf.get("mock_vops_data_path")
if mock_vops_data_path:
MockVopsProvider.load_block_data(mock_vops_data_path)
MockVopsProvider.print_data()
# ensure db schema up to date, check app status
DbState.initialize()
Blocks.setup_own_db_access(self._db)
......@@ -399,7 +386,7 @@ class Sync:
self._db.query("""UPDATE hive_state SET block_num = :block_num,
steem_per_mvest = :spm, usd_per_steem = :ups,
sbd_per_steem = :sps, dgpo = :dgpo""",
block_num=state['dgpo']['head_block_number'],
block_num=Blocks.head_num(),
spm=state['steem_per_mvest'],
ups=state['usd_per_steem'],
sps=state['sbd_per_steem'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment