1 from twisted.internet import defer
4 from p2pool.util import math, pack
6 BitcoinMainnet = math.Object(
7 P2P_PREFIX='f9beb4d9'.decode('hex'),
11 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
12 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
13 not (yield bitcoind.rpc_getinfo())['testnet']
15 POW_FUNC=data.hash256,
18 BitcoinTestnet = math.Object(
19 P2P_PREFIX='fabfb5da'.decode('hex'),
23 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
24 'bitcoinaddress' in (yield bitcoind.rpc_help()) and
25 (yield bitcoind.rpc_getinfo())['testnet']
27 POW_FUNC=data.hash256,
31 NamecoinMainnet = math.Object(
32 P2P_PREFIX='f9beb4fe'.decode('hex'),
36 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
37 'namecoinaddress' in (yield bitcoind.rpc_help()) and
38 not (yield bitcoind.rpc_getinfo())['testnet']
40 POW_FUNC=data.hash256,
43 NamecoinTestnet = math.Object(
44 P2P_PREFIX='fabfb5fe'.decode('hex'),
48 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
49 'namecoinaddress' in (yield bitcoind.rpc_help()) and
50 (yield bitcoind.rpc_getinfo())['testnet']
52 POW_FUNC=data.hash256,
56 LitecoinMainnet = math.Object(
57 P2P_PREFIX='fbc0b6db'.decode('hex'),
61 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
62 'litecoinaddress' in (yield bitcoind.rpc_help()) and
63 not (yield bitcoind.rpc_getinfo())['testnet']
65 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
68 LitecoinTestnet = math.Object(
69 P2P_PREFIX='fcc1b7dc'.decode('hex'),
73 RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
74 'litecoinaddress' in (yield bitcoind.rpc_help()) and
75 (yield bitcoind.rpc_getinfo())['testnet']
77 POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),