Post-merge fixups, runs, doesnt connect

This commit is contained in:
Jon Layton 2018-03-05 20:04:28 -06:00
parent 0ca9fc8391
commit 75c1b17681
5 changed files with 29 additions and 14 deletions

View File

@ -84,7 +84,10 @@ def hash_header(header):
if header is None: if header is None:
return '0' * 64 return '0' * 64
if header.get('prev_block_hash') is None: if header.get('prev_block_hash') is None:
header['prev_block_hash'] = '00'*64 ''' TODO 32? ''' header['prev_block_hash'] = '00'*64
'''
TODO 32?
'''
return hash_encode(Hash(bfh(serialize_header(header)))) return hash_encode(Hash(bfh(serialize_header(header))))

View File

@ -37,18 +37,26 @@ def read_json(filename, default):
return r return r
class BitcoinMainnet: class BitcoinMainnet:
TESTNET = False TESTNET = False
WIF_PREFIX = 0x80 WIF_PREFIX = 0x80
ADDRTYPE_P2PKH = 0 ADDRTYPE_P2PKH = [0x1C, 0xB8]
ADDRTYPE_P2SH = 5 ADDRTYPE_P2SH = [0x1C, 0xBD]
SEGWIT_HRP = "bc" ADDRTYPE_SHIELDED = [0x16, 0x9A]
GENESIS = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" SEGWIT_HRP = "bc" # (No ZCL Segwit)
GENESIS = "0007104ccda289427919efc39dc9e4d499804b7bebc22df55f8b834301260602"
DEFAULT_PORTS = {'t': '50001', 's': '50002'} DEFAULT_PORTS = {'t': '50001', 's': '50002'}
DEFAULT_SERVERS = read_json('servers.json', {}) DEFAULT_SERVERS = read_json('servers.json', {})
CHECKPOINTS = read_json('checkpoints.json', []) CHECKPOINTS = read_json('checkpoints.json', [])
EQUIHASH_N = 200
EQUIHASH_K = 9
CHUNK_SIZE = 200
XPRV_HEADERS = { XPRV_HEADERS = {
'standard': 0x0488ade4, # xprv 'standard': 0x0488ade4, # xprv
'p2wpkh-p2sh': 0x049d7878, # yprv 'p2wpkh-p2sh': 0x049d7878, # yprv
@ -69,14 +77,20 @@ class BitcoinTestnet:
TESTNET = True TESTNET = True
WIF_PREFIX = 0xef WIF_PREFIX = 0xef
ADDRTYPE_P2PKH = 111 ADDRTYPE_P2PKH = [0x1D, 0x25]
ADDRTYPE_P2SH = 196 ADDRTYPE_P2SH = [0x1C, 0xBA]
SEGWIT_HRP = "tb" ADDTYPE_SHIELDED = [0x16, 0xB6]
SEGWIT_HRP = "tb" # (ZCL has no Segwit)
GENESIS = "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943" GENESIS = "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"
DEFAULT_PORTS = {'t': '51001', 's': '51002'} DEFAULT_PORTS = {'t': '51001', 's': '51002'}
DEFAULT_SERVERS = read_json('servers_testnet.json', {}) DEFAULT_SERVERS = read_json('servers_testnet.json', {})
CHECKPOINTS = read_json('checkpoints_testnet.json', []) CHECKPOINTS = read_json('checkpoints_testnet.json', [])
EQUIHASH_N = 200
EQUIHASH_K = 9
CHUNK_SIZE = 200
XPRV_HEADERS = { XPRV_HEADERS = {
'standard': 0x04358394, # tprv 'standard': 0x04358394, # tprv
'p2wpkh-p2sh': 0x044a4e28, # uprv 'p2wpkh-p2sh': 0x044a4e28, # uprv

View File

@ -31,9 +31,7 @@ import threading
import time import time
import traceback import traceback
from .util import print_error, get_cert_path from .util import print_error
ca_path = get_cert_path()
from . import util from . import util
from . import x509 from . import x509

View File

@ -1,5 +1,5 @@
{ {
"electrum.zclassic.org": {"s":"5222"}, "electrum.zclassic.org": {"s":"5222", "pruning": "-", "version": "1.1"},
"zcl-electrum.com": {"s":"50002"} "zcl-electrum.com": {"s":"50002", "pruning": "-", "version": "1.1"}
} }

View File

@ -23,7 +23,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
from . import util from . import util
from .util import profiler, bh2u, get_cert_path from .util import profiler, bh2u
import ecdsa import ecdsa
import hashlib import hashlib