testnet settings

This commit is contained in:
nxsofsys 2018-01-18 21:13:45 +03:00
parent 7ce3a33f26
commit f596d6e105
2 changed files with 10 additions and 4 deletions

View File

@ -99,9 +99,9 @@ class NetworkConstants:
cls.WIF_PREFIX = 0xef
cls.ADDRTYPE_P2PKH = [0x1D, 0x25]
cls.ADDRTYPE_P2SH = [0x1C, 0xBA]
cls.ADDRTYPE_SHIELDED [0x16, 0xB6]
cls.ADDRTYPE_SHIELDED = [0x16, 0xB6]
cls.SEGWIT_HRP = "tb" #TODO zcl has no segwit
cls.GENESIS = "03e1c4bb705c871bf9bfda3e74b7f8f86bff267993c215a89d5795e3708e5e1f"
cls.GENESIS = "041a201b82fdd5e129e798e45a1c893c1e423c9103633d0baa357ace72cde447"
cls.DEFAULT_PORTS = {'t': '51001', 's': '51002'}
cls.DEFAULT_SERVERS = read_json('servers_testnet.json', {})
cls.CHECKPOINTS = read_json('checkpoints_testnet.json', [])
@ -112,7 +112,7 @@ class NetworkConstants:
cls.CHUNK_SIZE = 200
NetworkConstants.set_mainnet()
NetworkConstants.set_testnet()
################################## transactions

View File

@ -949,11 +949,16 @@ class Network(util.DaemonThread):
def init_headers_file(self):
b = self.blockchains[0]
filename = b.path()
open(filename, 'wb+').close()
self.downloading_headers = False
return
print(b.get_hash(0), NetworkConstants.GENESIS)
if b.get_hash(0) == NetworkConstants.GENESIS:
self.downloading_headers = False
return
filename = b.path()
def download_thread():
try:
import urllib, socket
@ -976,6 +981,7 @@ class Network(util.DaemonThread):
t.start()
def run(self):
print('zzzzzzzzzzzzzzzzzzzz')
self.init_headers_file()
while self.is_running() and self.downloading_headers:
time.sleep(1)