From 144c285adda6c573899ab71887f254ad5d5633d5 Mon Sep 17 00:00:00 2001
From: Marcin Ickiewicz <mickiewicz@syncad.com>
Date: Thu, 5 Nov 2020 09:30:26 +0100
Subject: [PATCH] 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
---
 hive/indexer/sync.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hive/indexer/sync.py b/hive/indexer/sync.py
index f023e36cf..2f6813c23 100644
--- a/hive/indexer/sync.py
+++ b/hive/indexer/sync.py
@@ -399,7 +399,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'],
-- 
GitLab