Add Litecoin network.
[p2pool.git] / p2pool / litecoin.py
1 from twisted.internet import defer
2
3 class LitecoinMainnet(object):
4     BITCOIN_P2P_PREFIX = 'fbc0b6db'.decode('hex')
5     BITCOIN_P2P_PORT = 9333
6     BITCOIN_ADDRESS_VERSION = 48
7     BITCOIN_RPC_PORT = 9332
8     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
9         'litecoinaddress' in (yield bitcoind.rpc_help()) and
10         not (yield bitcoind.rpc_getinfo())['testnet']
11     )))
12     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//840000)
13     BITCOIN_SYMBOL = 'LTC'
14
15 class LitecoinTestnet(object):
16     BITCOIN_P2P_PREFIX = 'fcc1b7dc'.decode('hex')
17     BITCOIN_P2P_PORT = 19333
18     BITCOIN_ADDRESS_VERSION = 111
19     BITCOIN_RPC_PORT = 19332
20     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
21         'litecoinaddress' in (yield bitcoind.rpc_help()) and
22         (yield bitcoind.rpc_getinfo())['testnet']
23     )))
24     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//840000)
25     BITCOIN_SYMBOL = 'tLTC'