1
0

move max_checkpoint from network to constants

This commit is contained in:
SomberNight
2018-09-09 05:00:09 +02:00
parent 2f224819ac
commit cdca74aa39
5 changed files with 31 additions and 18 deletions

View File

@@ -37,7 +37,14 @@ def read_json(filename, default):
return r
class BitcoinMainnet:
class AbstractNet:
@classmethod
def max_checkpoint(cls) -> int:
return max(0, len(cls.CHECKPOINTS) * 2016 - 1)
class BitcoinMainnet(AbstractNet):
TESTNET = False
WIF_PREFIX = 0x80
@@ -66,7 +73,7 @@ class BitcoinMainnet:
BIP44_COIN_TYPE = 0
class BitcoinTestnet:
class BitcoinTestnet(AbstractNet):
TESTNET = True
WIF_PREFIX = 0xef