Skip to content

Commit

Permalink
Incomplete Maxcoin support: MerkleRootMismatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtobey committed May 2, 2014
1 parent 5ca1ba9 commit 3bd2552
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
27 changes: 26 additions & 1 deletion Abe/Chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import util

def create(policy, **kwargs):
#print "create(%s, %r)" % (policy, kwargs)
# XXX It's about time to interpret policy as a module name.
if policy in [None, "Bitcoin"]: return Bitcoin(**kwargs)
if policy == "Testnet": return Testnet(**kwargs)
if policy == "Namecoin": return Namecoin(**kwargs)
Expand All @@ -30,6 +30,8 @@ def create(policy, **kwargs):
if policy == "Hirocoin": return Hirocoin(**kwargs)
if policy == "X11": return X11Chain(**kwargs)
if policy == "Bitleu": return Bitleu(**kwargs)
if policy == "Keccak": return KeccakChain(**kwargs)
if policy == "Maxcoin": return Maxcoin(**kwargs)
return Sha256NmcAuxPowChain(**kwargs)


Expand Down Expand Up @@ -391,3 +393,26 @@ def __init__(chain, **kwargs):
datadir_conf_file_name = "Bitleu.conf"
datadir_rpcport = 7997
start_time = 1394480376

def _double_sha3_256(s):
import hashlib
import sys
if sys.version_info < (3, 4):
import sha3
return hashlib.sha3_256(hashlib.sha3_256(s).digest()).digest()

class KeccakChain(Chain):
def block_header_hash(chain, header):
return _double_sha3_256(header)

class Maxcoin(KeccakChain):
def __init__(chain, **kwargs):
chain.name = 'Maxcoin'
chain.code3 = 'MAX'
chain.address_version = '\x6e'
chain.script_addr_vers = '\x70'
chain.magic = "\xf9\xbe\xbb\xd2"
Chain.__init__(chain, **kwargs)

datadir_conf_file_name = 'maxcoin.conf'
datadir_rpcport = 8669
1 change: 1 addition & 0 deletions Abe/DataStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
{"chain":"Anoncoin","code3":"ANC", "address_version":"\u0017", "magic":"\xFA\xCA\xBA\xDA" },
{"chain":"Hirocoin"},
{"chain":"Bitleu"},
{"chain":"Maxcoin"},
#{"chain":"",
# "code3":"", "address_version":"\x", "magic":""},
]
Expand Down
4 changes: 4 additions & 0 deletions Abe/genesis_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def get(tx_hash_hex):
if tx_hash_hex == "30cbad942f9fe09d06cabc91773860a827f3625a72eb2ae830c2c8844ffb6de2":
return "01000000f8141e53010000000000000000000000000000000000000000000000000000000000000000ffffffff1904ffff001d020f27104269746c65752072656c61756e63682effffffff0100000000000000000000000000"

# Maxcoin
if tx_hash_hex == "f8cc3b46c273a488c318dc7d98cc053494af2871e495e17f5c7c246055e46af3": # XXX not sure that's right
return "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff3c04ffff001d01043453686170652d7368696674696e6720736f66747761726520646566656e647320616761696e737420626f746e6574206861636b73ffffffff010065cd1d00000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"

# Extract your chain's genesis transaction data from the first
# block file and add it here, or better yet, patch your coin's
# getrawtransaction to return it on request:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ README-SCRYPT.txt).
Hirocoin (and any other X11) support depends on the xcoin_hash module
available from https://github.com/evan82/xcoin-hash.

Bitleu (a Scrypt-Jane coin) depends on the yac_scrypt module.

Copperlark (a Keccak coin) depends on the sha3 module available via
"easy_install pysha3".

License
-------

Expand Down

0 comments on commit 3bd2552

Please sign in to comment.