fixed up RPC identity checkers
[p2pool.git] / p2pool / bitcoin / networks.py
index 7f9d358..8c9a68f 100644 (file)
@@ -9,8 +9,7 @@ class BitcoinMainnet(object):
     BITCOIN_ADDRESS_VERSION = 0
     BITCOIN_RPC_PORT = 8332
     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
+        'bitcoinaddress' in (yield bitcoind.rpc_help()) and
         not (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
@@ -23,8 +22,7 @@ class BitcoinTestnet(object):
     BITCOIN_ADDRESS_VERSION = 111
     BITCOIN_RPC_PORT = 8332
     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
+        'bitcoinaddress' in (yield bitcoind.rpc_help()) and
         (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
@@ -38,8 +36,7 @@ class NamecoinMainnet(object):
     BITCOIN_ADDRESS_VERSION = 52
     BITCOIN_RPC_PORT = 8332
     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
+        'namecoinaddress' in (yield bitcoind.rpc_help()) and
         not (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
@@ -52,8 +49,7 @@ class NamecoinTestnet(object):
     BITCOIN_ADDRESS_VERSION = 111
     BITCOIN_RPC_PORT = 8332
     BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
+        'namecoinaddress' in (yield bitcoind.rpc_help()) and
         (yield bitcoind.rpc_getinfo())['testnet']
     )))
     BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 50*100000000 >> (height + 1)//210000)
@@ -61,80 +57,6 @@ class NamecoinTestnet(object):
     BITCOIN_SYMBOL = 'tNMC'
 
 
-class IxcoinMainnet(object):
-    BITCOIN_P2P_PREFIX = 'f9beb4d9'.decode('hex')
-    BITCOIN_P2P_PORT = 8337
-    BITCOIN_ADDRESS_VERSION = 138
-    BITCOIN_RPC_PORT = 8338
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' in (yield bitcoind.rpc_help()) and
-        not (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 96*100000000 >> (height + 1)//210000)
-    BITCOIN_POW_FUNC = data.block_header_type.hash256
-    BITCOIN_SYMBOL = 'IXC'
-
-class IxcoinTestnet(object):
-    BITCOIN_P2P_PREFIX = 'fabfb5da'.decode('hex')
-    BITCOIN_P2P_PORT = 18337
-    BITCOIN_ADDRESS_VERSION = 111
-    BITCOIN_RPC_PORT = 8338
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' in (yield bitcoind.rpc_help()) and
-        (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 96*100000000 >> (height + 1)//210000)
-    BITCOIN_POW_FUNC = data.block_header_type.hash256
-    BITCOIN_SYMBOL = 'tIXC'
-
-
-class I0coinMainnet(object):
-    BITCOIN_P2P_PREFIX = 'f1b2b3d4'.decode('hex')
-    BITCOIN_P2P_PORT = 7333
-    BITCOIN_ADDRESS_VERSION = 105
-    BITCOIN_RPC_PORT = 7332
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
-        'i0coinaddress' in (yield bitcoind.rpc_help()) and
-        not (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 48*100000000 >> (height + 1)//218750)
-    BITCOIN_POW_FUNC = data.block_header_type.hash256
-    BITCOIN_SYMBOL = 'I0C'
-
-class I0coinTestnet(object):
-    BITCOIN_P2P_PREFIX = 'f5b6b7d8'.decode('hex')
-    BITCOIN_P2P_PORT = 17333
-    BITCOIN_ADDRESS_VERSION = 112
-    BITCOIN_RPC_PORT = 7332
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'name_firstupdate' not in (yield bitcoind.rpc_help()) and
-        'ixcoinaddress' not in (yield bitcoind.rpc_help()) and
-        'i0coinaddress' in (yield bitcoind.rpc_help()) and
-        (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 48*100000000 >> (height + 1)//218750)
-    BITCOIN_POW_FUNC = data.block_header_type.hash256
-    BITCOIN_SYMBOL = 'tI0C'
-
-
-class SolidcoinMainnet(object):
-    BITCOIN_P2P_PREFIX = 'deadbabe'.decode('hex')
-    BITCOIN_P2P_PORT = 7555
-    BITCOIN_ADDRESS_VERSION = 125
-    BITCOIN_RPC_PORT = 8332
-    BITCOIN_RPC_CHECK = staticmethod(defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
-        'solidcoinaddress' in (yield bitcoind.rpc_help()) and
-        not (yield bitcoind.rpc_getinfo())['testnet']
-    )))
-    BITCOIN_SUBSIDY_FUNC = staticmethod(lambda height: 32*100000000 >> (height + 1)//300000)
-    BITCOIN_POW_FUNC = data.block_header_type.hash256
-    BITCOIN_SYMBOL = 'SC'
-
-
 class LitecoinMainnet(object):
     BITCOIN_P2P_PREFIX = 'fbc0b6db'.decode('hex')
     BITCOIN_P2P_PORT = 9333