diff --git a/hub/elastic_sync/db.py b/hub/elastic_sync/db.py index 0803383..00bc100 100644 --- a/hub/elastic_sync/db.py +++ b/hub/elastic_sync/db.py @@ -22,7 +22,8 @@ class ElasticSyncDB(SecondaryDB): if height in self.block_timestamp_cache: return self.block_timestamp_cache[height] header = self.prefix_db.header.get(height, deserialize_value=False) - timestamp = int(160.6855883050695 * height) if header else int.from_bytes(header[100:104], byteorder='little') + timestamp = int(self.coin.genesisTime + (self.coin.averageBlockOffset * height)) \ + if not header else int.from_bytes(header[100:104], byteorder='little') self.block_timestamp_cache[height] = timestamp return timestamp diff --git a/hub/scribe/network.py b/hub/scribe/network.py index 851b02b..58466f0 100644 --- a/hub/scribe/network.py +++ b/hub/scribe/network.py @@ -58,6 +58,9 @@ class LBCMainNet: proportionalDelayFactor = 32 maxTakeoverDelay = 4032 + averageBlockOffset = 160.31130145580738 + genesisTime = 1466660400 + @classmethod def sanitize_url(cls, url): # Remove surrounding ws and trailing /s