Skip to content

Commit

Permalink
Setting ProgPow block number
Browse files Browse the repository at this point in the history
  • Loading branch information
a-bezrukov committed Oct 26, 2021
1 parent c6089a2 commit dbfea44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions electrum_dash/coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class Firo(Coin):
PRE_MTP_BLOCKS = 117564
PRE_MTP_HEADER_SIZE = 80
MTP_HEADER_SIZE = 180
PRE_PROGPOW_BLOCKS = 3000000000
AFTER_PROGPOW_BLOCK_HEIGHT = 419264
PROGPOW_HEADER_SIZE = 120
PROGPOW_START_TIME = 3333333333
PROGPOW_START_TIME = 1635228000

@classmethod
def static_header_offset(cls, height):
if height > cls.PRE_PROGPOW_BLOCKS:
return cls.static_header_offset(cls.PRE_PROGPOW_BLOCKS) + (height - cls.PRE_PROGPOW_BLOCKS) * cls.PROGPOW_HEADER_SIZE
if height > cls.AFTER_PROGPOW_BLOCK_HEIGHT:
return cls.static_header_offset(cls.AFTER_PROGPOW_BLOCK_HEIGHT) + (height - cls.AFTER_PROGPOW_BLOCK_HEIGHT) * cls.PROGPOW_HEADER_SIZE
if height > cls.PRE_MTP_BLOCKS:
return cls.static_header_offset(cls.PRE_MTP_BLOCKS) + (height - cls.PRE_MTP_BLOCKS) * cls.MTP_HEADER_SIZE
return cls.PRE_MTP_HEADER_SIZE * height
Expand All @@ -32,7 +32,7 @@ def get_header_size(self, header: bytes):

@classmethod
def get_header_size_height(cls, height: int):
if height >= cls.PRE_PROGPOW_BLOCKS:
if height >= cls.AFTER_PROGPOW_BLOCK_HEIGHT:
return cls.PROGPOW_HEADER_SIZE
if height >= cls.PRE_MTP_BLOCKS:
return cls.MTP_HEADER_SIZE
Expand All @@ -54,13 +54,13 @@ def file_size_to_height(cls, fileSize: int):
preMtpSize = cls.static_header_offset(cls.PRE_MTP_BLOCKS)
if fileSize <= preMtpSize:
return fileSize // cls.PRE_MTP_HEADER_SIZE
preProgpowSize = cls.static_header_offset(cls.PRE_PROGPOW_BLOCKS)
preProgpowSize = cls.static_header_offset(cls.AFTER_PROGPOW_BLOCK_HEIGHT)
if fileSize <= preProgpowSize:
return cls.PRE_MTP_BLOCKS + (fileSize - preMtpSize) // cls.MTP_HEADER_SIZE
return cls.PRE_PROGPOW_BLOCKS + (fileSize - preProgpowSize) // cls.PROGPOW_HEADER_SIZE
return cls.AFTER_PROGPOW_BLOCK_HEIGHT + (fileSize - preProgpowSize) // cls.PROGPOW_HEADER_SIZE


class FiroTestnet(Firo):
PRE_MTP_BLOCKS = 1
PRE_PROGPOW_BLOCKS = 37305
AFTER_PROGPOW_BLOCK_HEIGHT = 37305
PROGPOW_START_TIME = 1630069200
4 changes: 2 additions & 2 deletions electrum_dash/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re


ELECTRUM_VERSION = '4.1.5.0' # version of the client package
APK_VERSION = '4.1.5.0' # read by buildozer.spec
ELECTRUM_VERSION = '4.1.5.1' # version of the client package
APK_VERSION = '4.1.5.1' # read by buildozer.spec

PROTOCOL_VERSION = '1.4.2' # protocol version requested

Expand Down

0 comments on commit dbfea44

Please sign in to comment.