From 6c0f901d33e4db8eae790be44ddd8e1bf70f6a30 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 16 Jun 2022 15:26:54 -0400 Subject: [PATCH] fix updating the block height in udp pong responses --- hub/db/db.py | 1 - hub/herald/service.py | 4 ++-- hub/scribe/service.py | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hub/db/db.py b/hub/db/db.py index b3cdc3d..9df0ff5 100644 --- a/hub/db/db.py +++ b/hub/db/db.py @@ -942,7 +942,6 @@ class SecondaryDB: self.read_db_state() # These are our state as we move ahead of DB state - self.fs_height = self.db_height self.fs_tx_count = self.db_tx_count self.last_flush_tx_count = self.fs_tx_count diff --git a/hub/herald/service.py b/hub/herald/service.py index aa4e0c4..1ce9ecc 100644 --- a/hub/herald/service.py +++ b/hub/herald/service.py @@ -86,9 +86,9 @@ class HubServerService(BlockchainReaderService): async def poll_for_changes(self): await super().poll_for_changes() - if self.db.fs_height <= 0: + if self.db.db_height <= 0: return - self.status_server.set_height(self.db.fs_height, self.db.db_tip) + self.status_server.set_height(self.db.db_height, self.db.db_tip) if self.notifications_to_send: for (touched, height) in self.notifications_to_send: await self.mempool.on_block(touched, height) diff --git a/hub/scribe/service.py b/hub/scribe/service.py index 4234193..5602e0f 100644 --- a/hub/scribe/service.py +++ b/hub/scribe/service.py @@ -1396,7 +1396,6 @@ class BlockchainProcessorService(BlockchainService): self.db.block_hashes.append(self.env.coin.header_hash(block.header)) self.tip = self.coin.header_hash(block.header) - self.db.fs_height = self.height self.db.fs_tx_count = self.tx_count self.db.hist_flush_count += 1 self.db.hist_unflushed_count = 0 @@ -1591,10 +1590,9 @@ class BlockchainProcessorService(BlockchainService): # Not certain this is needed, but it doesn't hurt self.db.hist_flush_count += 1 - while self.db.fs_height > self.height: - self.db.fs_height -= 1 + while self.db.db_height > self.height: + self.db.db_height -= 1 self.db.utxo_flush_count = self.db.hist_flush_count - self.db.db_height = self.height self.db.db_tx_count = self.tx_count self.db.db_tip = self.tip # Flush state last as it reads the wall time.