Make the default reorg_limit a coin property

This commit is contained in:
Neil Booth 2016-11-18 08:12:43 +09:00
parent c31896a290
commit 66c493dbf4
2 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ class CoinError(Exception):
class Coin(object):
'''Base class of coin hierarchy.'''
REORG_LIMIT=200
# Not sure if these are coin-specific
HEADER_LEN = 80
DEFAULT_RPC_PORT = 8332
@ -244,6 +245,7 @@ class Bitcoin(Coin):
class BitcoinTestnet(Coin):
NAME = "Bitcoin"
SHORTNAME = "XTN"
REORG_LIMIT = 2000
NET = "testnet"
XPUB_VERBYTES = bytes.fromhex("043587cf")
XPRV_VERBYTES = bytes.fromhex("04358394")

View File

@ -29,7 +29,7 @@ class Env(LoggedClass):
self.utxo_MB = self.integer('UTXO_MB', 1000)
self.hist_MB = self.integer('HIST_MB', 300)
self.host = self.default('HOST', 'localhost')
self.reorg_limit = self.integer('REORG_LIMIT', 200)
self.reorg_limit = self.integer('REORG_LIMIT', self.coin.REORG_LIMIT)
self.daemon_url = self.build_daemon_url()
# Server stuff
self.tcp_port = self.integer('TCP_PORT', None)